1900 |
InsertControlItem / UserEditor / A2X:
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutBackColor(RGB(240,240,240)); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->GetConditionalFormats()->Add(L"1 = 1",vtMissing)->PutBold(VARIANT_TRUE); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Type")))->PutAlignment(EXG2ANTTLib::RightAlignment); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("1. A ProgID such as \"MSCAL.Calendar.7\""); var_Items->PutItemDivider(h,0); long hX = var_Items->InsertControlItem(0,L"MSCAL.Calendar",""); /* Copy and paste the following directives to your header file as it defines the namespace 'MSACAL' for the library: 'Microsoft Calendar Control 2007' #import <MSCAL.OCX> */ ((MSACAL::ICalendarPtr)(var_Items->GetItemObject(hX)))->PutBackColor(RGB(255,255,255)); h = var_Items->AddItem("2. A CLSID such as \"{0036F83C-D892-4B7B-AA0B-BEDD8D16A738}\""); var_Items->PutItemDivider(h,0); hX = var_Items->InsertControlItem(0,L"{0036F83C-D892-4B7B-AA0B-BEDD8D16A738}",""); h = var_Items->AddItem("3. A URL such as \"http://www.exontrol.com\""); var_Items->PutItemDivider(h,0); hX = var_Items->InsertControlItem(0,L"http://www.exontrol.com",""); h = var_Items->AddItem("4. A reference to an Active document such as \"file://\\\\Documents\\MyDoc.doc\""); var_Items->PutItemDivider(h,0); hX = var_Items->InsertControlItem(0,L"file://C:\\empesting.xml",""); h = var_Items->AddItem("5.A fragment of HTML such as \"MSHTML:<HTML><BODY>This is a line of text</BODY></HTML>\""); var_Items->PutItemDivider(h,0); hX = var_Items->InsertControlItem(0,L"MSHTML:<HTML><BODY>This is a <b>line of</b> text</BODY></HTML>",""); var_Items->PutItemHeight(hX,56); h = var_Items->AddItem("6.Anything, if it is preffixed by \"A2X:\""); var_Items->PutItemDivider(h,0); hX = var_Items->InsertControlItem(0,L"A2X:TOC24.Toc24Ctrl.1",""); spG2antt1->EndUpdate(); |
1899 |
How do I add a RichTextBox editor
|
1898 |
Is it possible to trap a double-click event on a specific cell and when that happens, to set the cell to a specific value
// DblClick event - Occurs when the user dblclk the left mouse button over an object. void OnDblClickG2antt1(short Shift,long X,long Y) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); long h = spG2antt1->GetItemFromPoint(-1,-1,c,hit); OutputDebugStringW( _bstr_t(spG2antt1->GetItems()->GetCellValue(h,c)) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Etched); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); spG2antt1->GetColumns()->Add(L"C1"); spG2antt1->GetColumns()->Add(L"C2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("Item 1"),long(1),"Item 2"); var_Items->PutCellValue(var_Items->AddItem("Item 3"),long(1),"Item 4"); var_Items->PutCellValue(var_Items->AddItem("Item 5"),long(1),"Item 6"); spG2antt1->EndUpdate(); |
1897 |
How can I display dates in DD/MM/YYYY format
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_FALSE); spG2antt1->GetColumns()->Add(L"Date"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutItemDivider(var_Items->AddItem("Different Date Formats"),0); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"((shortdateF(value) mid 4) left 2) + `/` + (shortdateF (value) left 2) + `/` + (shortdateF (value) right 4)"); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"(1 array (0:=(shortdateF(value) split `/`))) + `/` + (0 array (=:0) ) + `/` + (2 array (=:0) )"); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"((`0` + day(value) ) right 2) + `/` + ((`0` + month(value) ) right 2) + `/` + year(value)"); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"day(value) + `/` + month(value) + `/` + year(value)"); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"year(value) + ` - ` + day(value) + ` - ` + month(value)"); long h = var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()); var_Items->PutItemHeight(h,24); var_Items->PutCellValueFormat(h,long(0),EXG2ANTTLib::exHTML); var_Items->PutFormatCell(h,long(0),L"`<b>` + year(value) + `</b><off -4> ` + day(value) + ` - ` + month(value)"); var_Items->PutItemDivider(var_Items->AddItem("Predefined Date Formats"),0); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"value"); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"shortdateF(value)"); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"shortdate(value)"); var_Items->PutFormatCell(var_Items->AddItem(COleDateTime(1971,12,1,0,00,00).operator DATE()),long(0),L"longdate(value)"); spG2antt1->EndUpdate(); |
1896 |
I have noticed that the column gets resized once I release the mouse. I have a column that displays multiple-lines cells, and the text gets wrapped only when user releases the mouse. Is it possible to get resized contiguously as I had before
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_FALSE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exVLines); spG2antt1->PutColumnsAllowSizing(VARIANT_TRUE); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Column A (cont)")))->PutDef(EXG2ANTTLib::exColumnResizeContiguously,VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Column 1"); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Column B (cont)")))->PutDef(EXG2ANTTLib::exColumnResizeContiguously,VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Column 2"); spG2antt1->EndUpdate(); |
1895 |
How do I get the column from cursor, when it hovers the empty portion of the items section
|
1894 |
How do I add items once the user clicks the empty area
// Click event - Occurs when the user presses and then releases the left mouse button over the tree control. void OnClickG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); long i = spG2antt1->GetItemFromPoint(0,-1,c,hit); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(i),long(1),c); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Number of Items to Add"); spG2antt1->GetColumns()->Add(L"Click on Column"); spG2antt1->EndUpdate(); |
1893 |
Is there an easy way to get an effect like in a Microsoft Access / SQL-Server Table view, where you can scroll-up till the last row containing data is displayed as top-row
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutHasLines(EXG2ANTTLib::exNoLine); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenKeyset,ADODB::adLockReadOnly,0); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(1994,10,21,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutScrollBars(EXG2ANTTLib::ScrollBarsEnum(EXG2ANTTLib::exVScrollEmptySpace | EXG2ANTTLib::exBoth)); spG2antt1->PutScrollPos(VARIANT_TRUE,spG2antt1->GetItems()->GetItemCount()); spG2antt1->EndUpdate(); |
1892 |
Is there any option to stop events
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"AddItem event is fired only if FreezeEvents(False) is called" ); } // AddLink event - Occurs when the user links two bars using the mouse. void OnAddLinkG2antt1(LPCTSTR LinkKey) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"AddLink event is fired only if FreezeEvents(False) is called" ); } // BarResize event - Occurs when a bar is moved or resized. void OnBarResizeG2antt1(long Item,VARIANT Key) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"BarResize event is fired only if FreezeEvents(False) is called" ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->FreezeEvents(VARIANT_TRUE); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(24); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); var_Items->AddLink("L1",h1,"",h2,""); var_Items->SchedulePDM(0,""); spG2antt1->EndUpdate(); spG2antt1->FreezeEvents(VARIANT_FALSE); |
1891 |
How do I specify a more intensive color if using RenderType property
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->PutRenderType(-16777216); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABN0GACAADACAxRDAMgBQKAAzQFAYahuGSGAAGMYxQgmFgAQhFcZQSKUOQTDKMIziYBYJhEMQyDAAUIjOKsIhkGYcZAGQBJCjWGodQLOEgwH") + "IERQjEyUJAGGQIHhyPYbUbGUpQHKkeRtGqgBgoKhKEouNYgAbGYIwTRsdyfDSXBpEWwbDgkNQwWTDNoRDIUQStCysaYjOpnfrUAJ1P7FdQ1NJkXRhGSSK7maapaiCSZ6" + "STCMj1FhVKSNJ7DQKhGpgKh/ApgYpQOK4fLNXyRBK4QAyKA6bgPFZOZbFViaXY1V5bNKrcjhHQwAyHJ4XXRdV4YRAkUT4GqiJKGSYcQhuXZWbRqO6ABhef6DRThc6jKp" + "FHIE4llEcojHqSZNgoIxnlgd5thsLREleL43gsYZ9BkaAYkMAgAm+CxGDWWAtiKCRfjcdRgHoHYnicUwgAIEIREAaQYkcQZUHIGRUDQJBOEYRAhDYCxGgMZAkCgdYQha" + "XQIAYERwQuahXggdgeG6VZ4H4IhdiIGIOB8YIiGiHZZgqYpGF4KYHiKCI+CAU5jCiTQ2g0YhEFyax4gABAEIC"); var_Appearance->Add(2,_bstr_t("gBFLBCJwBAEHhEJAAEhABU0IQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRhGcTAJBMIhiGQYAChEZxVhEMgzDjIAxSJAcQRFESaAABGCQG") + "h+N4/S4NIi0CIsZQjCaiZ7pKA5bgMCo+UrNMixZQVCSOGChYRpCaZWpGGodQRUFbVHAlKypJKCKrEWSrDhuYAAW7XM7yBS1TzVNSuLZtaLqSroAJ1WTWMB0Ra8NzZEKf" + "aZACj4arKejrRDCMAggI="); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar->PutColor(0x1000000); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->GetItem("Summary"); var_Bar1->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar1->PutColor(0x2000000); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummaryJ = var_Items->AddItem("Summary A"); var_Items->AddBar(hSummaryJ,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"J",vtMissing); long hTaskJ = var_Items->InsertItem(hSummaryJ,vtMissing,"Task A.1"); var_Items->AddBar(hTaskJ,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"J1",vtMissing); hTaskJ = var_Items->InsertItem(hSummaryJ,vtMissing,"Task A.2"); var_Items->AddBar(hTaskJ,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"J2",vtMissing); var_Items->DefineSummaryBars(hSummaryJ,"J",-1,"<*>"); long hSummaryK = var_Items->AddItem("Summary B"); var_Items->AddBar(hSummaryK,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"K",vtMissing); long hTaskK = var_Items->InsertItem(hSummaryK,vtMissing,"Task B.1"); var_Items->AddBar(hTaskK,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTaskK = var_Items->InsertItem(hSummaryK,vtMissing,"Task B.2"); var_Items->AddBar(hTaskK,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); var_Items->DefineSummaryBars(hSummaryK,"K",-1,"<*>"); var_Items->PutItemBar(0,"<K*>",EXG2ANTTLib::exBarColor,long(255)); var_Items->PutExpandItem(0,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1890 |
How can I include the child items, when a filter is applied
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutColumnAutoResize(VARIANT_TRUE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutSearchColumnIndex(1); spG2antt1->PutIndent(16); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutFilterBarPromptVisible(VARIANT_TRUE); spG2antt1->PutFilterBarPromptPattern(L"Nancy"); spG2antt1->PutFilterInclude(EXG2ANTTLib::exItemsWithChilds); spG2antt1->GetChart()->PutLevelCount(2); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Name")))->PutWidth(96); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Title")))->PutWidth(96); var_Columns->Add(L"City"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h0 = var_Items->AddItem("Nancy Davolio"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Seattle"); h0 = var_Items->InsertItem(h0,vtMissing,"Andrew Fuller"); var_Items->PutCellValue(h0,long(1),"Vice President, Sales"); var_Items->PutCellValue(h0,long(2),"Tacoma"); h0 = var_Items->InsertItem(h0,vtMissing,"Michael Suyama"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Janet Leverling"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Kirkland"); h0 = var_Items->InsertItem(h0,vtMissing,"Margaret Peacock"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Redmond"); var_Items->PutExpandItem(0,VARIANT_TRUE); spG2antt1->ApplyFilter(); spG2antt1->EndUpdate(); |
1889 |
Is it possible to change the date format shown when you scroll the horizontal bar on the chart
|
1888 |
How do I change the drop down filter icon/button (white)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(2,_bstr_t("gBFLBCJwBAEHhEJAAEhABX8GACAADACAxSDEMQBQKAAzQFAYbhgHCGAAGQaBUgmFgAQhFcZQSKUOQTDKNYykCIRSDUJYkSZEIyjBI8ExXFqNACkGKwYgmNYiTLAcgAN") + "J0WBaGIZJ4gOT5fDKMoEDRRYADFCscwxJybQAqGQKKb+VgAVY/cTyBIAEQSKA0TDOQ5TSKWB4JPZQRBEbZMNBtBIUJquKaqShdQJCU5FdY3Xblez9P7AMBwLFEC4NQ8Y" + "NYuPhjR4dRTIMhvVAsUArFh8Zg9GZZFjmDIDT4ydBLTQwcyVIKnP5qOa6XbmPoCQDYKxZHYxPzVDa3axuL76dqCAT7XrXNy1TbNRrzQKfcJqfCbdw2YaDZLOOT3fjuI4" + "hhKaRzFAHJ+jYQ4xHuY4gHuGIXGeExqC8Tp6C+PoEm+G5ImycRgh0XwvDGa5rgOeoejyXwnFeQp2mkf5ClgBB9gCWIYAwfYAEKV58mkdwOggNArgOXY2EWLoDkKOA0mg" + "bhOGgZApgaSBIHWSYHSmbApgYThmESZYJkIeIkgeCpfliLIHgpMIcmUYYYmODAlg2SI4mWfRfGOEguDcCRjFYAJihCQhJBSDoRmONgKEcI4kFCEJhhOVYTmYnAlEAQhW" + "BMJYJGYWoWmWSR2F6F5lnkWAQhUAgpEieRWEuSYkjWGpmkmNhuhuZwJkYcocmaaYkjyEhngnUA6lEFAlAEgI="); var_Appearance->Add(1,"CP:2 -4 -4 2 4"); spG2antt1->PutBackground(EXG2ANTTLib::exHeaderFilterBarButton,0x1000000); spG2antt1->PutBackground(EXG2ANTTLib::exCursorHoverColumn,spG2antt1->GetBackColor()); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::None2); spG2antt1->PutBackColorHeader(RGB(255,255,255)); spG2antt1->PutHeaderVisible(EXG2ANTTLib::exHeaderVisibleExtendLevels); spG2antt1->PutHeaderHeight(24); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Filter"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutAllowSort(VARIANT_FALSE); var_Column->PutAllowDragging(VARIANT_FALSE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,196); var_Chart->PutLevelCount(2); spG2antt1->EndUpdate(); |
1887 |
How do I prevent changing the cell's state ( check-box state )
|
1886 |
How do I change the color of the columns's header to cover all levels
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColorHeader()); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Etched); spG2antt1->PutDefaultItemHeight(36); spG2antt1->PutTreeColumnIndex(-1); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C1"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutWidth(24); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(3)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C2"))); var_Column1->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column1->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(2)); var_Columns->Add(L"Column1"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutBackColorLevelHeader(spG2antt1->GetBackColorHeader()); var_Chart->PutLevelCount(2); var_Chart->PutDrawGridLines(EXG2ANTTLib::exAllLines); var_Chart->PutFirstVisibleDate(COleDateTime(2014,6,22,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"Cell 1.2"); var_Items->PutCellValue(h,long(2),"Cell 1.3"); var_Items->AddBar(h,"Task",COleDateTime(2014,6,23,0,00,00).operator DATE(),COleDateTime(2014,6,25,0,00,00).operator DATE(),vtMissing,vtMissing); h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"Cell 2.2"); var_Items->PutCellValue(h,long(2),"Cell 2.3"); var_Items->AddBar(h,"Task",COleDateTime(2014,6,26,0,00,00).operator DATE(),COleDateTime(2014,6,28,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1885 |
Is it possible to extend the columns's header to fill all levels
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutHeaderVisible(EXG2ANTTLib::exHeaderVisibleExtendLevels); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Etched); spG2antt1->PutDefaultItemHeight(36); spG2antt1->PutTreeColumnIndex(-1); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C1"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutWidth(24); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(3)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C2"))); var_Column1->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column1->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(2)); var_Columns->Add(L"Column1"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutBackColorLevelHeader(spG2antt1->GetBackColorHeader()); var_Chart->PutLevelCount(2); var_Chart->PutDrawGridLines(EXG2ANTTLib::exAllLines); var_Chart->PutFirstVisibleDate(COleDateTime(2014,6,22,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"Cell 1.2"); var_Items->PutCellValue(h,long(2),"Cell 1.3"); var_Items->AddBar(h,"Task",COleDateTime(2014,6,23,0,00,00).operator DATE(),COleDateTime(2014,6,25,0,00,00).operator DATE(),vtMissing,vtMissing); h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"Cell 2.2"); var_Items->PutCellValue(h,long(2),"Cell 2.3"); var_Items->AddBar(h,"Task",COleDateTime(2014,6,26,0,00,00).operator DATE(),COleDateTime(2014,6,28,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1884 |
How do I change the color of the columns's header to cover all levels (sample CRD)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColorHeader()); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Etched); spG2antt1->PutDefaultItemHeight(36); spG2antt1->PutTreeColumnIndex(-1); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C1"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutWidth(24); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(3)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C2"))); var_Column1->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column1->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(2)); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Column1")))->PutVisible(VARIANT_FALSE); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Column2")))->PutVisible(VARIANT_FALSE); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Column3")))->PutVisible(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column2 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"FormatLevel"))); var_Column2->PutFormatLevel(L"18;\"Info\"[a=17]/(2/3,4)"); var_Column2->PutDef(EXG2ANTTLib::exCellFormatLevel,"2/3,4"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutDrawGridLines(EXG2ANTTLib::exAllLines); var_Chart->PutFirstVisibleDate(COleDateTime(2014,6,22,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutBackColorLevelHeader(spG2antt1->GetBackColorHeader()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"Cell 1.2"); var_Items->PutCellValue(h,long(2),"Cell 1.3"); var_Items->AddBar(h,"Task",COleDateTime(2014,6,23,0,00,00).operator DATE(),COleDateTime(2014,6,25,0,00,00).operator DATE(),vtMissing,vtMissing); h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"Cell 2.2"); var_Items->PutCellValue(h,long(2),"Cell 2.3"); var_Items->AddBar(h,"Task",COleDateTime(2014,6,26,0,00,00).operator DATE(),COleDateTime(2014,6,28,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1883 |
Is it possible to extend the columns's header to fill all levels (sample CRD)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutHeaderVisible(EXG2ANTTLib::exHeaderVisibleExtendLevels); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Etched); spG2antt1->PutDefaultItemHeight(36); spG2antt1->PutTreeColumnIndex(-1); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C1"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutWidth(24); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(3)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C2"))); var_Column1->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column1->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(2)); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Column1")))->PutVisible(VARIANT_FALSE); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Column2")))->PutVisible(VARIANT_FALSE); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Column3")))->PutVisible(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column2 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"FormatLevel"))); var_Column2->PutFormatLevel(L"18;\"Info\"[a=17]/(2/3,4)"); var_Column2->PutDef(EXG2ANTTLib::exCellFormatLevel,"2/3,4"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutDrawGridLines(EXG2ANTTLib::exAllLines); var_Chart->PutFirstVisibleDate(COleDateTime(2014,6,22,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutBackColorLevelHeader(spG2antt1->GetBackColorHeader()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"Cell 1.2"); var_Items->PutCellValue(h,long(2),"Cell 1.3"); var_Items->AddBar(h,"Task",COleDateTime(2014,6,23,0,00,00).operator DATE(),COleDateTime(2014,6,25,0,00,00).operator DATE(),vtMissing,vtMissing); h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"Cell 2.2"); var_Items->PutCellValue(h,long(2),"Cell 2.3"); var_Items->AddBar(h,"Task",COleDateTime(2014,6,26,0,00,00).operator DATE(),COleDateTime(2014,6,28,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1882 |
How do I get sorted the column as string, numeric, date, date and time. Also how can it be applied to drop down filter panel
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Date"))); var_Column->PutSortType(EXG2ANTTLib::SortDate); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutDisplayFilterDate(VARIANT_TRUE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox | EXG2ANTTLib::exSortItemsDesc)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"DateTime"))); var_Column1->PutSortType(EXG2ANTTLib::SortDateTime); var_Column1->PutDisplayFilterButton(VARIANT_TRUE); var_Column1->PutDisplayFilterPattern(VARIANT_FALSE); var_Column1->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox | EXG2ANTTLib::exSortItemsDesc)); EXG2ANTTLib::IColumnPtr var_Column2 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Time"))); var_Column2->PutSortType(EXG2ANTTLib::SortTime); var_Column2->PutDisplayFilterButton(VARIANT_TRUE); var_Column2->PutDisplayFilterPattern(VARIANT_FALSE); var_Column2->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox | EXG2ANTTLib::exSortItemsDesc)); var_Column2->PutFormatColumn(L"time(value)"); EXG2ANTTLib::IColumnPtr var_Column3 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Numeric"))); var_Column3->PutSortType(EXG2ANTTLib::SortNumeric); var_Column3->PutDisplayFilterButton(VARIANT_TRUE); var_Column3->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox | EXG2ANTTLib::exSortItemsDesc)); EXG2ANTTLib::IColumnPtr var_Column4 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"String"))); var_Column4->PutDisplayFilterButton(VARIANT_TRUE); var_Column4->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox | EXG2ANTTLib::exSortItemsDesc)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem(COleDateTime(2010,1,27,0,00,00).operator DATE()); var_Items->PutCellValue(h,long(1),COleDateTime(2010,1,27,10,00,00).operator DATE()); var_Items->PutCellValue(h,long(2),var_Items->GetCellValue(h,long(1))); var_Items->PutCellValue(h,long(3),long(1)); var_Items->PutCellValue(h,long(4),var_Items->GetCellValue(h,long(3))); h = var_Items->AddItem(COleDateTime(2011,1,27,0,00,00).operator DATE()); var_Items->PutCellValue(h,long(1),COleDateTime(2011,1,27,9,00,00).operator DATE()); var_Items->PutCellValue(h,long(2),var_Items->GetCellValue(h,long(1))); var_Items->PutCellValue(h,long(3),long(11)); var_Items->PutCellValue(h,long(4),var_Items->GetCellValue(h,long(3))); h = var_Items->AddItem(COleDateTime(2010,11,2,0,00,00).operator DATE()); var_Items->PutCellValue(h,long(1),COleDateTime(2010,11,2,9,00,00).operator DATE()); var_Items->PutCellValue(h,long(2),var_Items->GetCellValue(h,long(1))); var_Items->PutCellValue(h,long(3),long(2)); var_Items->PutCellValue(h,long(4),var_Items->GetCellValue(h,long(3))); spG2antt1->GetColumns()->GetItem("DateTime")->PutDisplayFilterDate(VARIANT_FALSE); spG2antt1->EndUpdate(); |
1881 |
Is there a way to set the time zone per item
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task A"); var_Items->AddBar(h1,"",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,18,0,00,00).operator DATE(),"TZ1","Time Zone / Item"); var_Items->PutItemBar(h1,"TZ1",EXG2ANTTLib::exBarSelectable,VARIANT_FALSE); var_Items->PutItemBar(h1,"TZ1",EXG2ANTTLib::exBarBackColor,long(255)); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,20,0,00,00).operator DATE(),COleDateTime(2001,1,29,0,00,00).operator DATE(),"Z1",vtMissing); h1 = var_Items->AddItem("Task B"); var_Items->AddBar(h1,"",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,24,0,00,00).operator DATE(),"TZ2","Time Zone / Item"); var_Items->PutItemBar(h1,"TZ2",EXG2ANTTLib::exBarSelectable,VARIANT_FALSE); var_Items->PutItemBar(h1,"TZ2",EXG2ANTTLib::exBarBackColor,long(65535)); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,12,0,00,00).operator DATE(),"Z1",vtMissing); spG2antt1->EndUpdate(); |
1880 |
Is there a way to turn arrow-key-navigation between the items on and off
// KeyDown event - Occurs when the user presses a key while an object has the focus. void OnKeyDownG2antt1(short FAR* KeyCode,short Shift) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); KeyCode = 0; } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Effort"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(21)); var_Column->GetEditor()->PutEditType(EXG2ANTTLib::SpinType); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutNonworkingDays(0); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->PutFirstVisibleDate(COleDateTime(2005,6,20,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(128); var_Chart->PutHistogramView(EXG2ANTTLib::exHistogramAllItems); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); var_Bar->PutHistogramType(EXG2ANTTLib::exHistOverload); var_Bar->PutHistogramCriticalValue(3); var_Bar->PutShowHistogramValues(L"value>3?255:1"); var_Bar->PutHistogramItems(-11); var_Bar->PutHistogramGridLinesColor(RGB(192,192,192)); var_Bar->PutHistogramRulerLinesColor(RGB(0,0,1)); var_Bar->PutFormatHistogramValues(L"value format `2`"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2005,6,21,0,00,00).operator DATE(),COleDateTime(2005,6,23,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellValue(h1,long(1),double(6.79)); h1 = var_Items->AddItem("Task 2"); var_Items->AddBar(h1,"Task",COleDateTime(2005,6,24,0,00,00).operator DATE(),COleDateTime(2005,6,26,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellValue(h1,long(1),double(3.19)); h1 = var_Items->AddItem("Task 3"); var_Items->AddBar(h1,"Task",COleDateTime(2005,6,27,0,00,00).operator DATE(),COleDateTime(2005,6,29,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellValue(h1,long(1),long(2)); h1 = var_Items->AddItem("Task 4"); var_Items->AddBar(h1,"Task",COleDateTime(2005,6,30,0,00,00).operator DATE(),COleDateTime(2005,7,2,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellValue(h1,long(1),long(1)); spG2antt1->EndUpdate(); |
1879 |
I am using Layout property to sort multiple columns at once. The problem is that all items get expanded. How do I prevent that
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"P1"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutPartialCheck(VARIANT_TRUE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"P2"))); var_Column1->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column1->PutPartialCheck(VARIANT_TRUE); var_Column1->PutFormatColumn(L"1 index ``"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child A"); var_Items->InsertItem(h,vtMissing,"Child B"); var_Items->InsertItem(h,vtMissing,"Child A"); var_Items->InsertItem(h,vtMissing,"Child B"); var_Items->AddItem("Root"); var_Items->AddItem("Root"); spG2antt1->PutSingleSort(VARIANT_FALSE); spG2antt1->PutLayout(L"multiplesort=\"C0:1 C1:2\";collapse=\"\""); spG2antt1->EndUpdate(); |
1878 |
How can I decode the Layout property
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"C1"); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C2")))->PutPosition(1); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("SubItem 1.1"),long(1),"SubItem 1.2"); var_Items->PutCellValue(var_Items->AddItem("SubItem 2.1"),long(1),"SubItem 2.2"); spG2antt1->GetColumns()->GetItem("C2")->PutSortOrder(EXG2ANTTLib::SortDescending); spG2antt1->EndUpdate(); OutputDebugStringW( L"Encoded:" ); OutputDebugStringW( spG2antt1->GetLayout() ); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'EXPRINTLib' for the library: 'ExPrint 1.0 Control Library' #import <ExPrint.dll> using namespace EXPRINTLib; */ EXPRINTLib::IExPrintPtr var_Print = ::CreateObject(L"Exontrol.Print"); OutputDebugStringW( L"Decoded: " ); OutputDebugStringW( var_Print->GetDecode64TextW(spG2antt1->GetLayout()) ); |
1877 |
Is it possible to define a bar inside a bar (method 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exHLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutDrawGridLines(EXG2ANTTLib::exHLines); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exCreateBarAuto); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exHour); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->GetBars()->GetItem("Task")->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Tasks"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A1",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"A2",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"A3",vtMissing); EXG2ANTTLib::INotesPtr var_Notes = spG2antt1->GetChart()->GetNotes(); EXG2ANTTLib::INotePtr var_Note = var_Notes->Add("N1",spG2antt1->GetItems()->GetFirstVisibleItem(),"A1",L""); var_Note->PutPartText(EXG2ANTTLib::exNoteStart,L" "); var_Note->PutPartFixedWidth(EXG2ANTTLib::exNoteStart,18); var_Note->PutPartFixedHeight(EXG2ANTTLib::exNoteStart,11); var_Note->PutPartCanMove(EXG2ANTTLib::exNoteStart,VARIANT_TRUE); var_Note->PutPartBackColor(EXG2ANTTLib::exNoteStart,RGB(0,255,0)); var_Note->PutPartVisible(EXG2ANTTLib::exNoteEnd,VARIANT_FALSE); var_Note->PutShowLink(EXG2ANTTLib::exNoteLinkHidden); var_Note->PutPartVOffset(EXG2ANTTLib::exNoteStart,4); spG2antt1->EndUpdate(); |
1876 |
Is it possible to define a bar inside a bar (method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exHLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutDrawGridLines(EXG2ANTTLib::exHLines); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exCreateBarAuto); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exHour); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); var_Bar->PutOverlaidGroup(L"Task,TaskB"); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->Add(L"Aka"); var_Bar1->PutColor(RGB(0,255,0)); var_Bar1->PutPattern(EXG2ANTTLib::exPatternSolid); EXG2ANTTLib::IBarPtr var_Bar2 = var_Chart->GetBars()->Add(L"Task%Aka"); var_Bar2->PutShortcut(L"TaskB"); var_Bar2->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); var_Bar2->PutOverlaidGroup(L"Task,TaskB"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Tasks"); var_Items->AddBar(h,"TaskB",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A1",vtMissing); var_Items->PutItemBar(h,"A1",EXG2ANTTLib::exBarPercent,double(0.25)); var_Items->AddBar(h,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"A2",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"A3",vtMissing); spG2antt1->EndUpdate(); |
1875 |
How do I show the bar with a solid color, no border (method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exHLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutDrawGridLines(EXG2ANTTLib::exHLines); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exCreateBarAuto); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exHour); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutColor(RGB(255,0,0)); var_Bar->PutPattern(EXG2ANTTLib::exPatternSolid); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"",vtMissing); spG2antt1->EndUpdate(); |
1874 |
How do I show the bar with a solid color, no border (method 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exHLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutDrawGridLines(EXG2ANTTLib::exHLines); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exCreateBarAuto); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exHour); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutColor(RGB(255,0,0)); var_Bar->PutStartColor(var_Bar->GetColor()); var_Bar->PutEndColor(var_Bar->GetColor()); var_Bar->PutPattern(EXG2ANTTLib::exPatternBox); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"",vtMissing); spG2antt1->EndUpdate(); |
1873 |
How do I show the bar with a solid color, no border (method 3)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exHLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutDrawGridLines(EXG2ANTTLib::exHLines); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exCreateBarAuto); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exHour); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->PutRenderType(-1); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABJkIQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyDQKkEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQiiCYsS5AcgPfKgAAFESNY5gSL5Y") + "j2IjrRDCMAggI"); EXG2ANTTLib::IBarPtr var_Bar = spG2antt1->GetChart()->GetBars()->GetItem("Task"); var_Bar->PutColor(0x10000ff); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"",vtMissing); spG2antt1->EndUpdate(); |
1872 |
How do I find the cell's type, or what the cell holds
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Value")))->PutWidth(24); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Type")))->PutFormatColumn(L"type(%0)"); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"TypeAsString")))->PutFormatColumn(_bstr_t("(0 := type(%0)) array (`empty`, `null`, `short`, `long`, `float`, `double`, `currency`, `date`, `string`, `object`, `error`, `b") + "oolean`, `variant`, `any`, `reserved`, `decimal`, `char`, `byte`, `unsigned short`, `unsigned long`, `long on 64 bits`)"); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Length")))->PutFormatColumn(L"len(%0)"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(vtMissing); var_Items->AddItem(""); var_Items->PutCellValue(->AddItem(vtMissing),long(0),((EXG2ANTTLib::IG2anttPtr)(spG2antt1))); var_Items->PutCellValue(var_Items->AddItem(vtMissing),long(0),VARIANT_TRUE); var_Items->PutCellValue(var_Items->AddItem(vtMissing),long(0),long(-1)); var_Items->PutCellValue(var_Items->AddItem(vtMissing),long(0),long(-1)); var_Items->PutCellValue(var_Items->AddItem(vtMissing),long(0),COleDateTime(2001,1,1,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1871 |
Is it possible to allow changing the bar's parent while bar's start/end margins should stay unchanged
// BarParentChange event - Occurs just before moving a bar from current item to another item. void OnBarParentChangeG2antt1(long Item,VARIANT Key,long NewItem,BOOL FAR* Cancel) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->PutSelectItem(NewItem,VARIANT_TRUE); OutputDebugStringW( L"BarParentChange from " ); OutputDebugStringW( spG2antt1->GetItems()->GetCellCaption(Item,long(0)) ); OutputDebugStringW( L" to " ); OutputDebugStringW( spG2antt1->GetItems()->GetCellCaption(NewItem,long(0)) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Members")))->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); spG2antt1->PutSelBackMode(EXG2ANTTLib::exTransparent); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutSelBackColor(spG2antt1->GetSelBackColor()); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,96); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar->PutDef(EXG2ANTTLib::exBarCanResize,VARIANT_FALSE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Member <b>1</b>"); long h = var_Items->AddItem("Member <b>2</b>"); var_Items->AddBar(h,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,23,0,00,00).operator DATE(),"T102","Task <b>102</b>"); var_Items->PutItemBar(h,"T102",EXG2ANTTLib::exBarCanMove,VARIANT_FALSE); var_Items->PutItemBar(h,"T102",EXG2ANTTLib::exBarCanMoveToAnother,VARIANT_TRUE); var_Items->AddItem("Member <b>3</b>"); var_Items->AddItem("Member <b>4</b>"); spG2antt1->EndUpdate(); |
1870 |
Is it possible to (un)highlight the day/night shifts
// Click event - Occurs when the user presses and then releases the left mouse button over the tree control. void OnClickG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutShowNonworkingHours(VARIANT_FALSE); var_Chart->PutBackColor(RGB(255,255,255)); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutUnitWidth(64); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutNonworkingHours(15728895); var_Chart->PutNonworkingHoursPattern(EXG2ANTTLib::exPatternSolid); var_Chart->PutNonworkingDaysPattern(var_Chart->GetNonworkingHoursPattern()); var_Chart->PutNonworkingHoursColor(RGB(240,240,240)); var_Chart->PutNonworkingDaysColor(RGB(212,212,212)); var_Chart->PutBackColor(RGB(250,250,250)); spG2antt1->EndUpdate(); |
1869 |
How can I add a vertical line at specified date-time
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,18); var_Chart->PutLevelCount(2); var_Chart->PutUnitWidth(32); var_Chart->PutFirstVisibleDate(COleDateTime(2010,1,1,0,00,00).operator DATE()); var_Chart->MarkTimeZone("M1",COleDateTime(2010,1,5,0,00,00).operator DATE(),COleDateTime(2010,1,5,0,00,00).operator DATE(),long(16711680),"50:5;3"); var_Chart->MarkTimeZone("M2",COleDateTime(2010,1,6,0,00,00).operator DATE(),COleDateTime(2010,1,6,0,00,00).operator DATE(),long(16711680),":5"); var_Chart->MarkTimeZone("M3",COleDateTime(2010,1,7,10,00,00).operator DATE(),COleDateTime(2010,1,7,10,00,00).operator DATE(),long(255),"50:3;;zone"); |
1868 |
How do I clear all date-time zones
// Click event - Occurs when the user presses and then releases the left mouse button over the tree control. void OnClickG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetChart()->RemoveTimeZone("<*>"); } // RClick event - Fired when right mouse button is clicked void OnRClickG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetChart()->RemoveTimeZone("<Z*>"); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,18); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2010,1,1,0,00,00).operator DATE()); var_Chart->MarkTimeZone("Z1",COleDateTime(2010,1,4,0,00,00).operator DATE(),COleDateTime(2010,1,5,0,00,00).operator DATE(),long(255),vtMissing); var_Chart->MarkTimeZone("Z2",COleDateTime(2010,1,11,0,00,00).operator DATE(),COleDateTime(2010,1,12,0,00,00).operator DATE(),long(65280),vtMissing); var_Chart->MarkTimeZone("M1",COleDateTime(2010,1,7,0,00,00).operator DATE(),COleDateTime(2010,1,8,0,00,00).operator DATE(),long(16711680),"50:5;3"); |
1867 |
How do I place a comment above/bellow the bar (sample 4)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(26); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,64); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarVAlignCaption,long(18)); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(0)); var_Bar->PutDef(EXG2ANTTLib::exBarExtraCaption," "); var_Bar->PutDef(EXG2ANTTLib::exBarExtraCaptionHAlign,long(0)); var_Bar->PutDef(EXG2ANTTLib::exBarExtraCaptionVAlign,long(16)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1","<font ;6>user comment"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaption,"<font ;6>user comment"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"K2","<font ;6>user comment"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaption,"<font ;6>user comment"); spG2antt1->EndUpdate(); |
1866 |
How do I place a comment above/bellow the bar (sample 3)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(26); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,64); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1","<font ;6>user comment"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarVAlignCaption,long(18)); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(0)); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaption,"<font ;6>user comment"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(0)); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaptionVAlign,long(16)); var_Items->AddBar(h,"Task",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"K2","<font ;6>user comment"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaption,"<font ;6>user comment"); spG2antt1->EndUpdate(); |
1865 |
How do I place a comment under the bar (sample 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(26); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,64); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarVAlignCaption,long(18)); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(0)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1","<font ;6>user comment"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"K2","<font ;6>user comment"); spG2antt1->EndUpdate(); |
1864 |
How do I place a comment under the bar (sample 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(26); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,64); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1","<font ;6>user comment"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarVAlignCaption,long(18)); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(0)); var_Items->AddBar(h,"Task",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"K2","<font ;6>user comment"); spG2antt1->EndUpdate(); |
1863 |
I am using exBarCanMoveToAnother to allow a bar to be moved from one item to another. The question is if it is possible somehow to highlight the current bar can be dropped to (sample 2)
// BarParentChange event - Occurs just before moving a bar from current item to another item. void OnBarParentChangeG2antt1(long Item,VARIANT Key,long NewItem,BOOL FAR* Cancel) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->PutSelectItem(NewItem,VARIANT_TRUE); Cancel = spG2antt1->GetConditionalFormats()->GetItem("NOTRED")->GetVerify(NewItem); } // ChartEndChanging event - Occurs after the chart has been changed. void OnChartEndChangingG2antt1(long Operation) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->PutSelForeColor(0x8000000e); spG2antt1->PutSelBackColor(0x8000000d); spG2antt1->GetChart()->PutSelBackColor(spG2antt1->GetSelBackColor()); spG2antt1->GetConditionalFormats()->Clear(); } // ChartStartChanging event - Occurs when the chart is about to be changed. void OnChartStartChangingG2antt1(long Operation) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->PutSelForeColor(spG2antt1->GetForeColor()); spG2antt1->PutSelBackColor(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutSelBackColor(var_Chart->GetBackColor()); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = spG2antt1->GetConditionalFormats()->Add(L"%0 contains `Allowed` ","RED"); var_ConditionalFormat->PutEnabled(VARIANT_FALSE); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat1 = spG2antt1->GetConditionalFormats()->Add(L"not ( %0 contains `Allowed` )","NOTRED"); var_ConditionalFormat1->PutBackColor(0x1fefefe); var_ConditionalFormat1->PutChartBackColor(var_ConditionalFormat1->GetBackColor()); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetVisualAppearance()->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABZkIQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyDQKkEwsACEIrjKCRShyCYZRrGUgRCKQahLEiTIhGUYJHgmK4tRoAUbyDBIGQSCCZYDmKA3f") + "j0AI9P7FcgSABEEigNIxToOU4jFgeCR2TqQRK1BDQbQSFCaZrmMKIXICO40WBQFhTdLlRyBBKzLKtCyaBqWaZrWxZE72ZaFVTdOK6bDvGwoarid56X7beA2PgdZTjQi5" + "cCxG5sLrTBZtYzfET3diOEYPQzHMpzDB7bxbGaXZBlGSZbjeGZBUjQc7yfSNMw/HqKZQ6cQwTAIgI"); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Members")))->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutSelBackColor(spG2antt1->GetSelBackColor()); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutAllowSelectObjects(EXG2ANTTLib::exNoSelectObjects); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->GetBars()->GetItem("Task")->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsIncludeCaption | EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Member <b>1</b>"); h = var_Items->AddItem("Member <b>Allowed</b>"); var_Items->AddBar(h,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,23,0,00,00).operator DATE(),"T102","Task <b>102</b>"); var_Items->PutItemBar(h,"T102",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"T102",EXG2ANTTLib::exBarCanMoveToAnother,VARIANT_TRUE); h = var_Items->AddItem("Member <b>Allowed</b>"); h = var_Items->AddItem("Member <b>4</b>"); spG2antt1->EndUpdate(); |
1862 |
I am using exBarCanMoveToAnother to allow a bar to be moved from one item to another. The question is if it is possible somehow to highlight the current bar can be dropped to (sample 1)
// BarParentChange event - Occurs just before moving a bar from current item to another item. void OnBarParentChangeG2antt1(long Item,VARIANT Key,long NewItem,BOOL FAR* Cancel) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->PutSelectItem(NewItem,VARIANT_TRUE); Cancel = spG2antt1->GetConditionalFormats()->GetItem("NOTRED")->GetVerify(NewItem); } // ChartEndChanging event - Occurs after the chart has been changed. void OnChartEndChangingG2antt1(long Operation) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->PutSelForeColor(0x8000000e); spG2antt1->PutSelBackColor(0x8000000d); spG2antt1->GetChart()->PutSelBackColor(spG2antt1->GetSelBackColor()); spG2antt1->GetConditionalFormats()->Clear(); } // ChartStartChanging event - Occurs when the chart is about to be changed. void OnChartStartChangingG2antt1(long Operation) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->PutSelForeColor(spG2antt1->GetForeColor()); spG2antt1->PutSelBackColor(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutSelBackColor(var_Chart->GetBackColor()); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = spG2antt1->GetConditionalFormats()->Add(L"%0 contains `Allowed` ","RED"); var_ConditionalFormat->PutBackColor(RGB(255,128,128)); var_ConditionalFormat->PutChartBackColor(var_ConditionalFormat->GetBackColor()); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat1 = spG2antt1->GetConditionalFormats()->Add(L"not ( %0 contains `Allowed` )","NOTRED"); var_ConditionalFormat1->PutEnabled(VARIANT_FALSE); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Members")))->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutSelBackColor(spG2antt1->GetSelBackColor()); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutAllowSelectObjects(EXG2ANTTLib::exNoSelectObjects); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->GetBars()->GetItem("Task")->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsIncludeCaption | EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Member <b>1</b>"); h = var_Items->AddItem("Member <b>Allowed</b>"); var_Items->AddBar(h,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,23,0,00,00).operator DATE(),"T102","Task <b>102</b>"); var_Items->PutItemBar(h,"T102",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"T102",EXG2ANTTLib::exBarCanMoveToAnother,VARIANT_TRUE); h = var_Items->AddItem("Member <b>Allowed</b>"); h = var_Items->AddItem("Member <b>4</b>"); spG2antt1->EndUpdate(); |
1861 |
How can I check, if a specified item fits a specified conditional format expression
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // MouseMove event - Occurs when the user moves the mouse. void OnMouseMoveG2antt1(short Button,short Shift,long X,long Y) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); long h = spG2antt1->GetItemFromPoint(-1,-1,c,hit); OutputDebugStringW( _bstr_t(spG2antt1->GetConditionalFormats()->GetItem("RED")->GetVerify(h)) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(1994,8,3,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); spG2antt1->GetChart()->PutSelBackColor(spG2antt1->GetSelBackColor()); spG2antt1->PutSelBackMode(EXG2ANTTLib::exTransparent); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); EXG2ANTTLib::IConditionalFormatsPtr var_ConditionalFormats = spG2antt1->GetConditionalFormats(); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = var_ConditionalFormats->Add(L"%1 = 5","RED"); var_ConditionalFormat->PutBackColor(RGB(255,128,128)); var_ConditionalFormat->PutChartBackColor(var_ConditionalFormat->GetBackColor()); spG2antt1->EndUpdate(); |
1860 |
Is it possible to apply the conditional format on the items shown on the chart part of the control (sample 3)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSelBackMode(EXG2ANTTLib::exTransparent); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutSelBackColor(spG2antt1->GetSelBackColor()); var_Chart->PutFirstVisibleDate(COleDateTime(1994,8,3,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); EXG2ANTTLib::IConditionalFormatsPtr var_ConditionalFormats = spG2antt1->GetConditionalFormats(); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = var_ConditionalFormats->Add(L"%1 in (3,5)",vtMissing); var_ConditionalFormat->PutApplyToBars(L"Task"); var_ConditionalFormat->PutBarColor(RGB(255,0,0)); var_ConditionalFormat->PutBarOverviewColor(RGB(255,0,0)); var_ConditionalFormat->PutForeColor(var_ConditionalFormat->GetBarColor()); var_ConditionalFormat->PutBold(VARIANT_TRUE); spG2antt1->EndUpdate(); |
1859 |
Is it possible to apply the conditional format on the items shown on the chart part of the control (sample 2)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSelBackMode(EXG2ANTTLib::exTransparent); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutSelBackColor(spG2antt1->GetSelBackColor()); var_Chart->PutFirstVisibleDate(COleDateTime(1994,8,3,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); EXG2ANTTLib::IConditionalFormatsPtr var_ConditionalFormats = spG2antt1->GetConditionalFormats(); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = var_ConditionalFormats->Add(L"%1 in (3,5)",vtMissing); var_ConditionalFormat->PutApplyTo(EXG2ANTTLib::FormatApplyToEnum(0x1)); var_ConditionalFormat->PutBackColor(RGB(255,128,128)); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat1 = var_ConditionalFormats->Add(L"%1 in (3,5)",vtMissing); var_ConditionalFormat1->PutApplyToBars(L"Task"); var_ConditionalFormat1->PutBarColor(RGB(255,0,0)); var_ConditionalFormat1->PutBarOverviewColor(RGB(255,0,0)); var_ConditionalFormat1->PutChartBackColor(RGB(255,128,128)); spG2antt1->EndUpdate(); |
1858 |
Is it possible to apply the conditional format on the items shown on the chart part of the control (sample 1)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(1994,8,3,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); spG2antt1->PutSelBackMode(EXG2ANTTLib::exTransparent); spG2antt1->PutBackColorAlternate(RGB(240,240,240)); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->GetChart()->PutSelBackColor(spG2antt1->GetSelBackColor()); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); EXG2ANTTLib::IConditionalFormatsPtr var_ConditionalFormats = spG2antt1->GetConditionalFormats(); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = var_ConditionalFormats->Add(L"%1 in (3,5)",vtMissing); var_ConditionalFormat->PutApplyToBars(L"Task"); var_ConditionalFormat->PutBarColor(RGB(255,0,0)); var_ConditionalFormat->PutBarOverviewColor(RGB(255,0,0)); var_ConditionalFormat->PutBackColor(RGB(255,128,128)); var_ConditionalFormat->PutChartBackColor(RGB(255,128,128)); spG2antt1->EndUpdate(); |
1857 |
How can I get ride / hide the image being dragged by OLE Drag and Drop
// OLEStartDrag event - Occurs when the OLEDrag method is called. void OnOLEStartDragG2antt1(LPDISPATCH Data,long FAR* AllowedEffects) { // Data.SetData("data to drag") /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); AllowedEffects = 1; } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->PutOLEDropMode(EXG2ANTTLib::exOLEDropManual); spG2antt1->PutBackground(EXG2ANTTLib::exDragDropAfter,RGB(255,255,255)); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); |
1856 |
How do I change the visual appearance of the split bars
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(24); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABEgDg6AADACAxSDEMQBQKAAzQFAYbhgHCGAAGMYhTgmFgAQhFcZQSB0Eg1BKMYwjOJgFgmEQxDQNIBQSLIYQiGSWZBGUBJDjWGgyQjOEByD") + "IMRwjE6UZBgeCRViEMo9RrSEZSLAdGRFAaVYDdULBEACU5VRZQFCwTQcBhpIyoZpkECobh2TYgQjYNT1NSkLxeGoSbbuGhBQrOAw1XTEMhyDR0LTJM6bMBACqrBi2L4x" + "URfOBRXLQAYbHjAZ7rSgacjKRpKRbmAV4Oh+O5pQjadp1TidNwHLoAK7nGwbbgmfwAZrAdjABj1HgBNS2dDkaabQrKEZ4XYAHAXVROOQTWIANb2XC4bwSLAwTJJYzjTh" + "iC2GInFOOQckiVw6AeCIvHSBzkCwDxfE6WZ2jsehICadx5kGYZdDgMRrA2c4NmWY56jyGxgEQJIgGkGJHEGVByBkWoCjkNAAAQIQ2AYRoDGQJAoKuZYgBgRZHggHZqAk" + "AZDjYGA7E8KB0kyB5LiiBgigiYhIgiQ4Jk4WIkn6CphjQDgbDmIwDBIMg3GMQ4uDaDZjgiZg6DIY5DGIPg/GQBAMneEJMFkFJqhGTppCYSoSmSSQ2EoPJlAMIhSDmZRE" + "AyVYVk0eRkm+FpkmkdhehaTp4iSZQxiYRAODIMQODmJJxhqTwJjYbobmcCZGHKGxLjmVQDC+J4DiYeg8GGWYuH6H5oAoBoCgcTwimaBodmeGZongPRPCoCoOiOZ5qBII" + "oiAuaZomkPoPGOToEiaaZKHaHYfiUA5OhMAAngoVh6iYKYqHqKoqmGWoGiOKRkHOKJ7D2TxKgaNotmuCpmFAPQrkqPh4iwaw6laOowmwOpwnSL4LmiXJ9D4TxbBqTozm" + "0CxGjwPRtEsIJsjWT4Dlydo1C2Sx2l6N5uAOWpijIDpbhYQ42i4K4mmqOpukuMpnjIJIjmKco5m8S5WnaPZkDuSJ4h0S46FKcY8m+DAHAGPovkoUhgD4cILmsCpCnCTA" + "2nKQgPhwFokh4JpjmsFpEDGDBnBqRpwgwWJ6kSKhZjie5FnGTIXCWR4yAmYh+D+D48g8HpLnMDJHDIPoylObwpWIY5/CyTJzkydw1kSIhzA6ZQ7E+fJrDWUZ0g0JxKks" + "T5NDSPJTmUaRcmAN5Nn0FJ/lMdYNGcWpWnWHRaGAMZ2AQDoEDKNhLicVpViQDYnGqWpPl2HxFDQNwJgoLoGGaCcDInRdjMCuNYbovR2D2FyNgNIcAJC5FWKwNwcBqAzC" + "WBoPgTA8BkEwFwN4HRjjyAMH8EgcQ5CaGIFoAAHQ3AgAAIAQBAQ=="); var_Appearance->Add(2,_bstr_t("gBFLBCJwBAEHhEJAAEhABBYDg6AADACAxSDEMQBQKAAzQFAYbhgHCGAAGMYhTgmFgAQhFcZQSB0Eg1BKMYwjOJgFgmEQxDQNIBQSLIYQiGSWZTgMYRSASI43RoMUIzV") + "AcQxDEaIZLlGQYHgkNIhDJPcZ0VDUbQGBiQIRmIAHNBwJJUVZFdBDLQkQy5HapZDkECobA+CZQTzUUI1LS9WS1HYaRJle4YRDUMJyQjdV4TRINHQvMinYzqOzrOhaW5T" + "SzLcqyCK0SxxR4AJ4yGobJjiQYJShXcxyDQ8dyZC7PQohG7ofxUAKDVjhMjZRQeMS9JCwaThHElRQHMyBdJkKA9Iq2WaGXBeeQ3JbNbzrYzHb5hHZgAzTOoWbzWFT8BJ" + "OFOCAYGcJJjHGTh+C2H40AAL5ckyBQDFkKoWHYLw9iGTpGDUY4zkIdwbF8JhbgMc5hF6OJ8C6BhTkOcBAlsR4NnQaAflAIQJBQBoRgwdAdEcIYVEUQJBGYOBCBMYQUGg" + "NhCEKB5FB4VBBgQXJgF+IAzA4Ig5GIQIQBwOxiGiIgngoYpIi4LoKiMA5KDIMwjEKakmk6OJkkmDpNgidgtgwI55AYJw5iQQwSEYNxkgiZJrEITppDSc4TkyCREmeFJk" + "CkAkLmWAwWFoOolkkNheDuJJJDSb4YmIQ4UkaGZlFkVJVhqTR5jYYw7mWeQ1AkPAnEmVh1C6Z4JiYL4KGQYwQmOH5PBoBh2h0EIaAaBg8GMI5Ij6IpokoNoOiOaJDiaE" + "oiA8KgegGIRpGoZoaiaaZDmCdYlGkZAmgmKJqEqFomimaoKCaIoqGqSo2iwQhknqRoyiyaxKlaNotk8OpCjiLprkqbQJD0LALAaQowmwSwWkaMZQhOVpKjKbJLDaTozm" + "0CxFAkPYtEsVpWjWbYLGaWo2lCGRil6N5pAuBpiDsbhLH6Zo3G4ax6HhYgpFibYjCWa4ml4QhPguVp2D4b4Li6bYPmiSZWngPhvGuWQJj+b5zmsBo+iePAmDCIwoGwGJ" + "6kEL4MA8EJDjCC46FWQwoBObwGkQD4UCcDpDg+PIHBWPpiHwYJxD+MgcH8BpH4cBJ7kicIrnKC4hg+fIjCoPoQhyOwuD8M5CnMPpJCMCIIkOOQOlOfw1k6MnJDwPw0GO" + "fhvDGdQNAIKdalOAJfDedJdC8SxCeyNJQleZhdEoJ4iEyLYWlWVx0GQJJslqTQtjcVJYi6aZ8mMM43EmFwCECJkfYyWiDuAuG0EgdBNB8AYHYMgxwEM1EAIAgIA=="); var_Appearance->Add(3,"CP:2 -2 -2 2 2"); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarsPtr var_Bars = var_Chart->GetBars(); EXG2ANTTLib::IBarPtr var_Bar = var_Bars->Add(L"A"); var_Bar->PutHeight(15); var_Bar->PutColor(0x2000000); var_Bar->PutPattern(EXG2ANTTLib::exPatternBDiagonal); EXG2ANTTLib::IBarPtr var_Bar1 = var_Bars->Add(L"Task:A"); var_Bar1->PutShortcut(L"Task"); var_Bar1->PutHeight(15); var_Bar1->PutColor(0x1000000); var_Bar1->PutDef(EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); var_Chart->PutNonworkingDaysColor(RGB(240,240,240)); var_Chart->PutSelBarColor(RGB(0,0,255)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),vtMissing,vtMissing); long h = var_Items->AddItem("Task 2"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(65535)); h = var_Items->AddItem("Task 3"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarSelected,VARIANT_TRUE); h = var_Items->AddItem("Task 4"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarNonWorkingColor,long(58753152)); h = var_Items->AddItem("Task 5"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarNonWorkingColor,long(25198720)); h = var_Items->AddItem("Task 6"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarNonWorkingColor,long(2130771712)); spG2antt1->EndUpdate(); |
1855 |
Is there a way to display automatically the duration ( days, hours, minutes ) of the bar next to it
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Tasks"))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(36); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutFirstVisibleDate(COleDateTime(2009,4,6,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->Add(L"Task:Progress"); var_Bar->PutShortcut(L"TaskS"); var_Bar->PutDef(EXG2ANTTLib::exBarCaption,_bstr_t("<%=((1:=int(0:= (%258))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != ") + "0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')%>"); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exMinute); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("T1"),"TaskS",COleDateTime(2009,4,10,2,30,00).operator DATE(),COleDateTime(2009,4,16,2,30,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("T2"),"TaskS",COleDateTime(2009,4,14,9,00,00).operator DATE(),COleDateTime(2009,4,22,10,10,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(0,"<*>",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); var_Items->PutItemBar(0,"<*>",EXG2ANTTLib::exBarHAlignCaption,long(18)); spG2antt1->EndUpdate(); |
1854 |
Is there a way to display automatically the duration ( days, hours, minutes ) of the bar next to it
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Tasks"))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(36); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutFirstVisibleDate(COleDateTime(2009,4,6,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exHour); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exMinute); var_Chart->GetBars()->GetItem("Task")->PutDef(EXG2ANTTLib::exBarCaption,_bstr_t("<%=((1:=int(0:= (%513))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != ") + "0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')%>"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("T1"),"Task",COleDateTime(2009,4,6,2,30,00).operator DATE(),COleDateTime(2009,4,6,12,35,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("T2"),"Task",COleDateTime(2009,4,6,9,00,00).operator DATE(),COleDateTime(2009,4,6,10,10,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(0,"<*>",EXG2ANTTLib::exBarHAlignCaption,long(18)); spG2antt1->EndUpdate(); |
1853 |
Does it support single or multiple split pane views
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutBackground(EXG2ANTTLib::exSplitBar,RGB(128,128,128)); spG2antt1->PutBackground(EXG2ANTTLib::exCSplitBar,RGB(40,40,40)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,76); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Summary"); var_Bar->PutPattern(EXG2ANTTLib::exPatternShadow); var_Bar->PutShape(EXG2ANTTLib::exShapeSolidDown); var_Bar->PutColor(RGB(0,0,255)); var_Bar->PutStartColor(var_Bar->GetColor()); var_Bar->PutEndColor(var_Bar->GetColor()); var_Chart->PutAllowSplitPane(EXG2ANTTLib::AllowSplitPaneEnum(EXG2ANTTLib::exAllowTwoSplitPane | EXG2ANTTLib::exAllowOneSplitPane)); var_Chart->PutSplitPaneWidth(L"128,128"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Summary"); var_Items->AddBar(hSummary,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"",vtMissing); long hTask = var_Items->InsertItem(hSummary,vtMissing,"Task A"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task B"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task C"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,2,23,0,00,00).operator DATE(),COleDateTime(2001,2,27,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); var_Items->DefineSummaryBars(hSummary,"",-1,"<*>"); spG2antt1->EndUpdate(); |
1852 |
How can I programmatically add more split panes ( by code)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutBackground(EXG2ANTTLib::exSplitBar,RGB(128,128,128)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,76); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Summary"); var_Bar->PutPattern(EXG2ANTTLib::exPatternShadow); var_Bar->PutShape(EXG2ANTTLib::exShapeSolidDown); var_Bar->PutColor(RGB(0,0,255)); var_Bar->PutStartColor(var_Bar->GetColor()); var_Bar->PutEndColor(var_Bar->GetColor()); var_Chart->PutAllowSplitPane(EXG2ANTTLib::exAllowOneSplitPane); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Summary"); var_Items->AddBar(hSummary,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"",vtMissing); long hTask = var_Items->InsertItem(hSummary,vtMissing,"Task A"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task B"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task C"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,2,23,0,00,00).operator DATE(),COleDateTime(2001,2,27,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); var_Items->DefineSummaryBars(hSummary,"",-1,"<*>"); EXG2ANTTLib::IChartPtr var_Chart1 = spG2antt1->GetChart(); var_Chart1->ScrollTo(var_Chart1->GetEndPrintDate(),long(1)); var_Chart1->PutSplitPaneWidth(L"128,128,128"); var_Chart1->ScrollTo(var_Chart1->GetStartPrintDate(),long(1)); spG2antt1->EndUpdate(); |
1851 |
How can I programmatically add a split pane, or adding a split view at runtime
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutBackground(EXG2ANTTLib::exCSplitBar,RGB(40,40,40)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,76); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Summary"); var_Bar->PutPattern(EXG2ANTTLib::exPatternShadow); var_Bar->PutShape(EXG2ANTTLib::exShapeSolidDown); var_Bar->PutColor(RGB(0,0,255)); var_Bar->PutStartColor(var_Bar->GetColor()); var_Bar->PutEndColor(var_Bar->GetColor()); var_Chart->PutAllowSplitPane(EXG2ANTTLib::exAllowOneSplitPane); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Summary"); var_Items->AddBar(hSummary,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"",vtMissing); long hTask = var_Items->InsertItem(hSummary,vtMissing,"Task A"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task B"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task C"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,2,23,0,00,00).operator DATE(),COleDateTime(2001,2,27,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); var_Items->DefineSummaryBars(hSummary,"",-1,"<*>"); EXG2ANTTLib::IChartPtr var_Chart1 = spG2antt1->GetChart(); var_Chart1->ScrollTo(var_Chart1->GetEndPrintDate(),long(1)); var_Chart1->PutSplitPaneWidth(L"128"); var_Chart1->ScrollTo(var_Chart1->GetStartPrintDate(),long(1)); spG2antt1->EndUpdate(); |
1850 |
Is there any way, property, procedure or anything else to split the control into multiple views
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutBackground(EXG2ANTTLib::exCSplitBar,RGB(40,40,40)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,76); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Summary"); var_Bar->PutPattern(EXG2ANTTLib::exPatternShadow); var_Bar->PutShape(EXG2ANTTLib::exShapeSolidDown); var_Bar->PutColor(RGB(0,0,255)); var_Bar->PutStartColor(var_Bar->GetColor()); var_Bar->PutEndColor(var_Bar->GetColor()); var_Chart->PutAllowSplitPane(EXG2ANTTLib::exAllowOneSplitPane); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Summary"); var_Items->AddBar(hSummary,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"",vtMissing); long hTask = var_Items->InsertItem(hSummary,vtMissing,"Task A"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task B"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task C"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,2,23,0,00,00).operator DATE(),COleDateTime(2001,2,27,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); var_Items->DefineSummaryBars(hSummary,"",-1,"<*>"); spG2antt1->EndUpdate(); |
1849 |
It appears that I can not use the ItemFromPoint property in my environment. What else I can do
// MouseMove event - Occurs when the user moves the mouse. void OnMouseMoveG2antt1(short Button,short Shift,long X,long Y) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( _bstr_t(spG2antt1->ExecuteTemplate(L"Dim c, hit; ItemFromPoint(-1,-1, c, hit )")) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Default"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutPartialCheck(VARIANT_TRUE); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1848 |
How can I change the color for selected links (ebn)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->PutRenderType(-2); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAEGg4BNkMQAAYAQGKIYBkAKBQAGaAoDDYNQwQwAAwjIKEEwsACEIrjKCVIgkHYJRjGEZxMAsEwjAoaQChEZRUhEMgxDDIIxAJIcaw0GSEZwgOQZB") + "iOEYnDANMgzDLMZR7DajYymSA6LiKNo+QjKFB0NLMVRtEIIIzCSCaNomT4DS4NIi2DYcVhhMqBYbtCZZBo2FpZUxXdL0BJMVxbHKYJikW4pVjoAJ+TxccjVDQNJyLQ6r" + "YzuAAKNpuO58RbdGDQHA9KyfLCEcTxYAMbp6X5kaBZVp2VCMRzbTLUIDzPNVCTrNIaJioAaMeiCG5NUzieqRNalLABFjZMIHDbtGynDIJZruW52+CLIZpWbEOiRXr2Tx" + "xgGYp5Fie5mAYBgIgSFDrDOIZUmQZYiECXJUjIEQ3lUGgbEIRQcg+Hg8DEFxYFuOR/i+X5znufh/omBgCgCVwjn4BoBmCCAmAqApgkefgMgOYQID4DoELsUgTgUYYIC4" + "F4GGGSAaBuBxhhgfgggUYgog4EYJGIaBJn6ChiBiLgsgkIpoj4J4BCMSJWDaDZjgiZgCEAQCAgA=="); var_Appearance->Add(2,"CP:1 -2 -2 2 2"); spG2antt1->PutDefaultItemHeight(24); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksStyle(EXG2ANTTLib::exLinkSolid); var_Chart->PutLinksWidth(2); var_Chart->PutSelLinkColor(0x20000ff); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); var_Items->AddLink("L1",h1,"",h2,""); var_Items->PutLink("L1",EXG2ANTTLib::exLinkSelected,VARIANT_TRUE); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); var_Items->AddLink("L2",h2,"",h3,""); var_Items->SchedulePDM(0,""); spG2antt1->EndUpdate(); |
1847 |
How can I change the color for selected links (color, no frame)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(24); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksStyle(EXG2ANTTLib::exLinkSolid); var_Chart->PutLinksWidth(2); var_Chart->PutSelLinkColor(0x7f0000ff); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); var_Items->AddLink("L1",h1,"",h2,""); var_Items->PutLink("L1",EXG2ANTTLib::exLinkSelected,VARIANT_TRUE); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); var_Items->AddLink("L2",h2,"",h3,""); var_Items->SchedulePDM(0,""); spG2antt1->EndUpdate(); |
1846 |
How can I change the color for selected links (color, frame)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(24); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksStyle(EXG2ANTTLib::exLinkSolid); var_Chart->PutLinksWidth(2); var_Chart->PutSelLinkColor(RGB(255,0,0)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); var_Items->AddLink("L1",h1,"",h2,""); var_Items->PutLink("L1",EXG2ANTTLib::exLinkSelected,VARIANT_TRUE); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"",vtMissing); var_Items->AddLink("L2",h2,"",h3,""); var_Items->SchedulePDM(0,""); spG2antt1->EndUpdate(); |
1845 |
By default, the bar gets selected once the user releases the button of the mouse. Is it possible to change this behavior so the bar gets selected once the user presses the button of the mouse
// MouseDown event - Occurs when the user presses a mouse button. void OnMouseDownG2antt1(short Button,short Shift,long X,long Y) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); long h = spG2antt1->GetItemFromPoint(-1,-1,c,hit); _variant_t b = spG2antt1->GetChart()->GetBarFromPoint(-1,-1); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutItemBar(0,"<*>",EXG2ANTTLib::exBarSelected,VARIANT_FALSE); var_Items->PutItemBar(h,b,EXG2ANTTLib::exBarSelected,VARIANT_TRUE); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(32); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAEGg4BNkMQAAYAQGKIYBkAKBQAGaAoDDYNQwQwAAwjIKEEwsACEIrjKCVIgkHYJRjGEZxMAsEwjAoaQChEZRUhEMgxDDIIxAJIcaw0GSEZwgOQZB") + "iOEYnDANMgzDLMZR7DajYymSA6LiKNo+QjKFB0NLMVRtEIIIzCSCaNomT4DS4NIi2DYcVhhMqBYbtCZZBo2FpZUxXdL0BJMVxbHKYJikW4pVjoAJ+TxccjVDQNJyLQ6r" + "YzuAAKNpuO58RbdGDQHA9KyfLCEcTxYAMbp6X5kaBZVp2VCMRzbTLUIDzPNVCTrNIaJioAaMeiCG5NUzieqRNalLABFjZMIHDbtGynDIJZruW52+CLIZpWbEOiRXr2Tx" + "xgGYp5Fie5mAYBgIgSFDrDOIZUmQZYiECXJUjIEQ3lUGgbEIRQcg+Hg8DEFxYFuOR/i+X5znufh/omBgCgCVwjn4BoBmCCAmAqApgkefgMgOYQID4DoELsUgTgUYYIC4" + "F4GGGSAaBuBxhhgfgggUYgog4EYJGIaBJn6ChiBiLgsgkIpoj4J4BCMSJWDaDZjgiZgCEAQCAgA=="); var_Appearance->Add(2,"CP:1 -2 -2 2 2"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutAllowSelectObjects(EXG2ANTTLib::exNoSelectObjects); var_Chart->PutFirstVisibleDate(COleDateTime(2002,1,1,0,00,00).operator DATE()); var_Chart->PutSelBarColor(0x2000000); var_Chart->PutPaneWidth(VARIANT_FALSE,48); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2002,1,2,0,00,00).operator DATE(),COleDateTime(2002,1,4,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2002,1,6,0,00,00).operator DATE(),COleDateTime(2002,1,10,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2002,1,11,0,00,00).operator DATE(),COleDateTime(2002,1,14,0,00,00).operator DATE(),"C",vtMissing); var_Items->PutItemBar(h,"B",EXG2ANTTLib::exBarSelected,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1844 |
How can I change the bar's color (sample 3, ebn, individual, global)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->PutRenderType(-2); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABN0GACAADACAxRDAMgBQKAAzQFAYahuGSGAAGMYxQgmFgAQhFcZQSKUOQTDKMIziYBYJhEMQyDAAUIjOKsIhkGYcZAGQBJCjWGodQLOEgwH") + "IERQjEyUJAGGQIHhyPYbUbGUpQHKkeRtGqgBgoKhKEouNYgAbGYIwTRsdyfDSXBpEWwbDgkNQwWTDNoRDIUQStCysaYjOpnfrUAJ1P7FdQ1NJkXRhGSSK7maapaiCSZ6" + "STCMj1FhVKSNJ7DQKhGpgKh/ApgYpQOK4fLNXyRBK4QAyKA6bgPFZOZbFViaXY1V5bNKrcjhHQwAyHJ4XXRdV4YRAkUT4GqiJKGSYcQhuXZWbRqO6ABhef6DRThc6jKp" + "FHIE4llEcojHqSZNgoIxnlgd5thsLREleL43gsYZ9BkaAYkMAgAm+CxGDWWAtiKCRfjcdRgHoHYnicUwgAIEIREAaQYkcQZUHIGRUDQJBOEYRAhDYCxGgMZAkCgdYQha" + "XQIAYERwQuahXggdgeG6VZ4H4IhdiIGIOB8YIiGiHZZgqYpGF4KYHiKCI+CAU5jCiTQ2g0YhEFyax4gABAEIC"); var_Appearance->Add(2,_bstr_t("gBFLBCJwBAEHhEJAAEhABU0IQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRhGcTAJBMIhiGQYAChEZxVhEMgzDjIAxSJAcQRFESaAABGCQG") + "h+N4/S4NIi0CIsZQjCaiZ7pKA5bgMCo+UrNMixZQVCSOGChYRpCaZWpGGodQRUFbVHAlKypJKCKrEWSrDhuYAAW7XM7yBS1TzVNSuLZtaLqSroAJ1WTWMB0Ra8NzZEKf" + "aZACj4arKejrRDCMAggI="); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar->PutColor(0x1000000); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->GetItem("Summary"); var_Bar1->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar1->PutColor(0x2000000); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummaryJ = var_Items->AddItem("Summary A"); var_Items->AddBar(hSummaryJ,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"J",vtMissing); long hTaskJ = var_Items->InsertItem(hSummaryJ,vtMissing,"Task A.1"); var_Items->AddBar(hTaskJ,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"J1",vtMissing); hTaskJ = var_Items->InsertItem(hSummaryJ,vtMissing,"Task A.2"); var_Items->AddBar(hTaskJ,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"J2",vtMissing); var_Items->DefineSummaryBars(hSummaryJ,"J",-1,"<*>"); long hSummaryK = var_Items->AddItem("Summary B"); var_Items->AddBar(hSummaryK,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"K",vtMissing); long hTaskK = var_Items->InsertItem(hSummaryK,vtMissing,"Task B.1"); var_Items->AddBar(hTaskK,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTaskK = var_Items->InsertItem(hSummaryK,vtMissing,"Task B.2"); var_Items->AddBar(hTaskK,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); var_Items->DefineSummaryBars(hSummaryK,"K",-1,"<*>"); var_Items->PutItemBar(0,"<K*>",EXG2ANTTLib::exBarColor,long(255)); var_Items->PutExpandItem(0,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1843 |
How can I change the bar's color (sample 2, global)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar->PutColor(RGB(255,0,0)); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->GetItem("Summary"); var_Bar1->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar1->PutColor(RGB(255,0,0)); var_Bar1->PutStartColor(var_Bar1->GetColor()); var_Bar1->PutEndColor(var_Bar1->GetColor()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummaryJ = var_Items->AddItem("Summary A"); var_Items->AddBar(hSummaryJ,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"J",vtMissing); long hTaskJ = var_Items->InsertItem(hSummaryJ,vtMissing,"Task A.1"); var_Items->AddBar(hTaskJ,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"J1",vtMissing); hTaskJ = var_Items->InsertItem(hSummaryJ,vtMissing,"Task A.2"); var_Items->AddBar(hTaskJ,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"J2",vtMissing); var_Items->DefineSummaryBars(hSummaryJ,"J",-1,"<*>"); long hSummaryK = var_Items->AddItem("Summary B"); var_Items->AddBar(hSummaryK,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"K",vtMissing); long hTaskK = var_Items->InsertItem(hSummaryK,vtMissing,"Task B.1"); var_Items->AddBar(hTaskK,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTaskK = var_Items->InsertItem(hSummaryK,vtMissing,"Task B.2"); var_Items->AddBar(hTaskK,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); var_Items->DefineSummaryBars(hSummaryK,"K",-1,"<*>"); var_Items->PutExpandItem(0,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1842 |
How can I change the bar's color (sample 1, individual)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->GetBars()->GetItem("Task")->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Chart->GetBars()->GetItem("Summary")->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummaryJ = var_Items->AddItem("Summary A"); var_Items->AddBar(hSummaryJ,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"J"," (default)"); long hTaskJ = var_Items->InsertItem(hSummaryJ,vtMissing,"Task A.1"); var_Items->AddBar(hTaskJ,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"J1","(default)"); hTaskJ = var_Items->InsertItem(hSummaryJ,vtMissing,"Task A.2"); var_Items->AddBar(hTaskJ,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"J2","(default)"); var_Items->DefineSummaryBars(hSummaryJ,"J",-1,"<*>"); long hSummaryK = var_Items->AddItem("Summary B"); var_Items->AddBar(hSummaryK,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"K",vtMissing); long hTaskK = var_Items->InsertItem(hSummaryK,vtMissing,"Task B.1"); var_Items->AddBar(hTaskK,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTaskK = var_Items->InsertItem(hSummaryK,vtMissing,"Task B.2"); var_Items->AddBar(hTaskK,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); var_Items->DefineSummaryBars(hSummaryK,"K",-1,"<*>"); var_Items->PutItemBar(hSummaryK,"",EXG2ANTTLib::exBarColor,long(255)); var_Items->PutItemBar(0,"<K*>",EXG2ANTTLib::exBarColor,long(255)); var_Items->PutExpandItem(0,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1841 |
How do I make the control read-only (method 2)
// Edit event - Occurs just before editing the focused cell. void OnEditG2antt1(long Item,long ColIndex,BOOL FAR* Cancel) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); Cancel = VARIANT_TRUE; } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IEditorPtr var_Editor = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Editor")))->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::CheckListType); var_Editor->AddItem(1,L"One",vtMissing); var_Editor->AddItem(2,L"Two",vtMissing); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Check"))); EXG2ANTTLib::IEditorPtr var_Editor1 = var_Column->GetEditor(); var_Editor1->PutEditType(EXG2ANTTLib::CheckValueType); var_Editor1->PutOption(EXG2ANTTLib::exCheckValue1,long(2)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(1)),long(1),long(0)); var_Items->PutCellValue(var_Items->AddItem(long(2)),long(1),long(1)); spG2antt1->EndUpdate(); |
1840 |
How do I make the control read-only (method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutReadOnly(EXG2ANTTLib::exReadOnly); EXG2ANTTLib::IEditorPtr var_Editor = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Editor")))->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::CheckListType); var_Editor->AddItem(1,L"One",vtMissing); var_Editor->AddItem(2,L"Two",vtMissing); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Check"))); EXG2ANTTLib::IEditorPtr var_Editor1 = var_Column->GetEditor(); var_Editor1->PutEditType(EXG2ANTTLib::CheckValueType); var_Editor1->PutOption(EXG2ANTTLib::exCheckValue1,long(2)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(1)),long(1),long(0)); var_Items->PutCellValue(var_Items->AddItem(long(2)),long(1),long(1)); spG2antt1->EndUpdate(); |
1839 |
The ReadOnly property does not prevent changing the column's check-box (sample 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutShowFocusRect(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"C1"))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(18); var_Column->GetEditor()->PutEditType(EXG2ANTTLib::CheckValueType); spG2antt1->GetColumns()->Add(L"C2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(0)),long(1),"Item 1"); var_Items->PutCellValue(var_Items->AddItem(long(-1)),long(1),"Item 2"); var_Items->PutCellValue(var_Items->AddItem(long(0)),long(1),"Item 3"); spG2antt1->PutReadOnly(EXG2ANTTLib::exReadOnly); spG2antt1->GetColumns()->GetItem(long(0))->GetEditor()->PutOption(EXG2ANTTLib::exCheckValue2,long(2)); spG2antt1->EndUpdate(); |
1838 |
The ReadOnly property does not prevent changing the column's check-box (sample 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutShowFocusRect(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"C1"))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(18); EXG2ANTTLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::CheckValueType); var_Editor->PutOption(EXG2ANTTLib::exCheckValue2,long(1)); spG2antt1->GetColumns()->Add(L"C2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(0)),long(1),"Item 1"); var_Items->PutCellValue(var_Items->AddItem(long(-1)),long(1),"Item 2"); var_Items->PutCellValue(var_Items->AddItem(long(0)),long(1),"Item 3"); spG2antt1->PutReadOnly(EXG2ANTTLib::exReadOnly); spG2antt1->EndUpdate(); |
1837 |
How can I change the visual appearance of the control's split bar (sample 3)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABPsIQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRrGUQxCKIZhzEgYRokAYYRDIMg5SBIETzFIMCQ9AaaJpieRJG") + "iiKoJSxHErgFD8QxzEKOZqnCapViAMpOAZQAwDAIoWhpKKBRhqOpRUhaID/WAAFCUZK4ASTDCyLRgNy4lACgI"); var_Appearance->Add(2,_bstr_t("gBFLBCJwBAEHhEJAAEhABPkIQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRrGUQxCKIZhzEgYRoiEYhXDiIAxARHcgyBIMPQJGSaZpkSRpI") + "iqHItS6BM4RVKkcw7G6BaJnGJpADKTQGQiMIwDAIoWhpKCBaiqSpqMglf5fg6pOJqHACZZKWLNLpxDBMAkBA="); var_Appearance->Add(3,_bstr_t("gBFLBCJwBAEHhEJAAEhABUUIQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRrGQCwTCIYhmHKSRhGSIRSDcOIgDCBEbyDIEQw9AiZZqmaRZH") + "imK4cS5MEhwHKsLSLGyOZwoSapbgmJooU5KUwSYKQcxBI6laYpIAKJhiWobTxUEBwMKlJw5KoBJxjKqIbp2XZsUxIAxXEA1HBgGASRZGS5bDreeQ0UZCL74GAFUy/Lib" + "a6weqnLhGCYBgIA=="); spG2antt1->PutBackground(EXG2ANTTLib::exSplitBar,0x1808080); spG2antt1->PutBackground(EXG2ANTTLib::exHSplitBar,0x2808080); spG2antt1->PutBackground(EXG2ANTTLib::exCSplitBar,0x3010101); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutOverviewHeight(48); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAll); spG2antt1->EndUpdate(); |
1836 |
How can I change the color for the control's split bar (sample 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Default"); spG2antt1->PutBackground(EXG2ANTTLib::exSplitBar,RGB(190,190,190)); spG2antt1->PutBackground(EXG2ANTTLib::exHSplitBar,RGB(128,128,128)); spG2antt1->PutBackground(EXG2ANTTLib::exCSplitBar,RGB(0,0,1)); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutOverviewHeight(48); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAll); spG2antt1->EndUpdate(); |
1835 |
How do I highlight a bar with an icon, exclamation mark or some warning sign, without using exBarCaption, exBarExtraCaption which I've already use for something else ( sample 2 )
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,26,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h = var_Items->AddItem("Item"); var_Items->AddItem(""); var_Items->AddBar(h,"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"A",vtMissing); EXG2ANTTLib::INotesPtr var_Notes = spG2antt1->GetChart()->GetNotes(); EXG2ANTTLib::INotePtr var_Note = var_Notes->Add("Attention",spG2antt1->GetItems()->GetItemByIndex(1),"A",L" <font ;11>! "); var_Note->PutRelativePosition(double(0.5)); var_Note->PutShowLink(EXG2ANTTLib::exNoteLinkHidden); var_Note->PutPartVOffset(EXG2ANTTLib::exNoteEnd,0); var_Note->PutPartShadow(EXG2ANTTLib::exNoteEnd,VARIANT_FALSE); var_Note->PutPartBackColor(EXG2ANTTLib::exNoteEnd,RGB(255,255,0)); spG2antt1->EndUpdate(); |
1834 |
How do I highlight a bar with an icon, exclamation mark or some warning sign, without using exBarCaption, exBarExtraCaption which I've already use for something else ( sample 1 )
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,26,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h = var_Items->AddItem("Item"); var_Items->AddItem(""); var_Items->AddBar(h,"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"A",vtMissing); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarBackgroundExt,"[text=`<bgcolor=FFFF00><font ;11> ! `,align=0x11]"); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarBackgroundExtInflate,long(8)); spG2antt1->EndUpdate(); |
1833 |
How do I get the "Summary" bar being shown in the control's histogram (sample 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->GetVisualAppearance()->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABU0IQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRhGcTAJBMIhiGQYAChEZxVhEMgzDjIAxSJAcQRFESaAABGCQG") + "h+N4/S4NIi0CIsZQjCaiZ7pKA5bgMCo+UrNMixZQVCSOGChYRpCaZWpGGodQRUFbVHAlKypJKCKrEWSrDhuYAAW7XM7yBS1TzVNSuLZtaLqSroAJ1WTWMB0Ra8NzZEKf" + "aZACj4arKejrRDCMAggI="); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutHistogramView(EXG2ANTTLib::HistogramViewEnum(EXG2ANTTLib::exHistogramNoGrouping | EXG2ANTTLib::exHistogramAllItems)); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); var_Bar->PutHistogramType(EXG2ANTTLib::exHistCumulative); var_Bar->PutHistogramCumulativeOriginalColorBars(EXG2ANTTLib::exKeepOriginalColor); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Summary"); var_Items->AddBar(hSummary,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(hSummary,"",EXG2ANTTLib::exBarColor,long(16777216)); long hTask = var_Items->InsertItem(hSummary,vtMissing,"Task A"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task B"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task C"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,12,0,00,00).operator DATE(),COleDateTime(2001,1,17,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); var_Items->DefineSummaryBars(hSummary,"",-1,"<*>"); spG2antt1->EndUpdate(); |
1832 |
How do I get the "Summary" bar being shown in the control's histogram (sample 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetVisualAppearance()->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABU0IQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRhGcTAJBMIhiGQYAChEZxVhEMgzDjIAxSJAcQRFESaAABGCQG") + "h+N4/S4NIi0CIsZQjCaiZ7pKA5bgMCo+UrNMixZQVCSOGChYRpCaZWpGGodQRUFbVHAlKypJKCKrEWSrDhuYAAW7XM7yBS1TzVNSuLZtaLqSroAJ1WTWMB0Ra8NzZEKf" + "aZACj4arKejrRDCMAggI="); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutHistogramView(EXG2ANTTLib::HistogramViewEnum(EXG2ANTTLib::exHistogramNoGrouping | EXG2ANTTLib::exHistogramAllItems)); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->GetItem("Summary"); var_Bar1->PutColor(0x1000000); var_Bar1->PutHistogramColor(RGB(0,0,1)); var_Bar1->PutHistogramPattern(EXG2ANTTLib::exPatternBDiagonal); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Summary"); var_Items->AddBar(hSummary,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"",vtMissing); long hTask = var_Items->InsertItem(hSummary,vtMissing,"Task A"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task B"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task C"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,12,0,00,00).operator DATE(),COleDateTime(2001,1,17,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); var_Items->DefineSummaryBars(hSummary,"",-1,"<*>"); spG2antt1->EndUpdate(); |
1831 |
How can I temporarily/programmatically hide the control's tooltip
// RClick event - Fired when right mouse button is clicked void OnRClickG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); long nToolTipDelay = spG2antt1->GetToolTipDelay(); spG2antt1->PutToolTipDelay(0); spG2antt1->PutToolTipDelay(nToolTipDelay); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Column w/h tooltip...")))->PutToolTip(L"This is a bit of text that's shown when the cursor hovers the column.<br><br><sha ;;0><c>Right-Click to hide it</sha>"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstWeekDay(var_Chart->GetLocFirstWeekDay()); var_Chart->PutMonthNames(var_Chart->GetLocMonthNames()); var_Chart->PutWeekDays(var_Chart->GetLocWeekDays()); var_Chart->PutAMPM(var_Chart->GetLocAMPM()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Flat); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); spG2antt1->EndUpdate(); |
1830 |
Is it possible to find out the handle of the item, giving the key of the bar only
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->PutDefaultItemHeight(32); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->GetBars()->GetItem("Task")->PutHeight(16); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutShowLinks(EXG2ANTTLib::exShowExtendedLinks); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBold(var_Items->GetItemBar(0,"K2",EXG2ANTTLib::exBarParent),VARIANT_TRUE); spG2antt1->EndUpdate(); |
1829 |
How can I programmatically add a link between two bars, knowing the keys of these bars only
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->PutDefaultItemHeight(32); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->GetBars()->GetItem("Task")->PutHeight(16); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutShowLinks(EXG2ANTTLib::exShowExtendedLinks); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"AK2",vtMissing); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"AK3",vtMissing); var_Items->AddLink("Link1",0,"K1",0,"AK2"); var_Items->AddLink("Link2",0,"K1",0,"<A?3>"); var_Items->AddLink("Link3",0,"<*2>",0,"AK3"); spG2antt1->EndUpdate(); |
1828 |
I'm trying to use automatic numbering of the outline. How can I have A, B, C for root items, 1, 2, 3 for the sub-items, and a, b, c for sub-sub-items (sample 3)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); spG2antt1->PutAutoDrag(EXG2ANTTLib::exAutoDragPositionAny); spG2antt1->PutHasLines(EXG2ANTTLib::exSolidLine); spG2antt1->PutIndent(16); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L""))); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutFormatColumn(L"((1:=(0 :=(1 rpos '.|A-Z||a-z|')) rfind `.`) < 0 ? `<b>` + =:0 + `` : (=:0 mid (1 + 1 + =:1) ) + `)` ) + ` ` + value"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child"); long hChild = var_Items->InsertItem(h,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(h,vtMissing,"Child"); var_Items->PutExpandItem(0,VARIANT_TRUE); h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child"); hChild = var_Items->InsertItem(h,vtMissing,"Child"); var_Items->PutCellState(hChild,long(0),1); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(h,vtMissing,"Child"); spG2antt1->EndUpdate(); |
1827 |
I'm trying to use automatic numbering of the outline. How can I have A, B, C for root items, 1, 2, 3 for the sub-items, and a, b, c for sub-sub-items (sample 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutGridLineColor(RGB(190,190,190)); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); spG2antt1->PutAutoDrag(EXG2ANTTLib::exAutoDragPositionAny); spG2antt1->PutHasLines(EXG2ANTTLib::exSolidLine); spG2antt1->PutIndent(16); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Default"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L""))); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutDef(EXG2ANTTLib::exCellPaddingRight,long(4)); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(36); var_Column->PutPosition(0); var_Column->PutFormatColumn(_bstr_t("(1:=(0 :=(1 rpos '.|A-Z||a-z|')) rfind `.`) < 0 ? `<b>` + =:0 : (`............` left 2 * (=:0 count `.`)) + (=:0 mid (1 + 1 + =") + ":1) ) "); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child"); long hChild = var_Items->InsertItem(h,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(h,vtMissing,"Child"); var_Items->PutExpandItem(0,VARIANT_TRUE); h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child"); hChild = var_Items->InsertItem(h,vtMissing,"Child"); var_Items->PutCellState(hChild,long(0),1); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(h,vtMissing,"Child"); spG2antt1->EndUpdate(); |
1826 |
I'm trying to use automatic numbering of the outline. How can I have A, B, C for root items, 1, 2, 3 for the sub-items, and a, b, c for sub-sub-items (sample 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); spG2antt1->PutAutoDrag(EXG2ANTTLib::exAutoDragPositionAny); spG2antt1->PutHasLines(EXG2ANTTLib::exSolidLine); spG2antt1->PutIndent(16); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Default"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L""))); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutDef(EXG2ANTTLib::exCellPaddingRight,long(4)); var_Column->PutAlignment(EXG2ANTTLib::RightAlignment); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(24); var_Column->PutPosition(0); var_Column->PutFormatColumn(L"(1:=(0 :=(1 rpos '.|A-Z||a-z|')) rfind `.`) < 0 ? `<b>` + =:0 : `<i>` + (=:0 mid (1 + 1 + =:1) ) "); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child"); long hChild = var_Items->InsertItem(h,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(h,vtMissing,"Child"); var_Items->PutExpandItem(0,VARIANT_TRUE); h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child"); hChild = var_Items->InsertItem(h,vtMissing,"Child"); var_Items->PutCellState(hChild,long(0),1); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(hChild,vtMissing,"Child"); var_Items->InsertItem(h,vtMissing,"Child"); spG2antt1->EndUpdate(); |
1825 |
How can I programmatically group by columns, without having the control's sort bar visible
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutSortBarHeight(0); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->PutLayout(L"multiplesort=\"C1:2\""); spG2antt1->EndUpdate(); |
1824 |
How do I perform my own sort
// Sort event - Fired when the control sorts a column. void OnSortG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Sort" ); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutItemPosition(var_Items->GetItemByIndex(1),0); var_Items->PutItemPosition(var_Items->GetItemByIndex(0),1); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSingleSort(VARIANT_FALSE); spG2antt1->PutSortOnClick(EXG2ANTTLib::exUserSort); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Index")))->PutFormatColumn(L"0 index ``"); var_Columns->Add(L"Data 1"); var_Columns->Add(L"Data 2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem(long(0)); var_Items->PutCellValue(h,long(1),long(2)); var_Items->PutCellValue(h,long(2),long(3)); h = var_Items->AddItem(long(4)); var_Items->PutCellValue(h,long(1),long(5)); var_Items->PutCellValue(h,long(2),long(6)); h = var_Items->AddItem(long(7)); var_Items->PutCellValue(h,long(1),long(8)); var_Items->PutCellValue(h,long(2),long(9)); spG2antt1->PutLayout(L"multiplesort=\"C1:1 C2:2\""); spG2antt1->EndUpdate(); |
1823 |
Is it possible to have a different alignment for parts of the cell's caption
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,VARIANT_TRUE); spG2antt1->PutTreeColumnIndex(-1); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Default"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellHAlignment(var_Items->AddItem("all-left"),long(0),EXG2ANTTLib::LeftAlignment); var_Items->PutCellHAlignment(var_Items->AddItem("all-center"),long(0),EXG2ANTTLib::CenterAlignment); var_Items->PutCellHAlignment(var_Items->AddItem("all-right"),long(0),EXG2ANTTLib::RightAlignment); long h = var_Items->AddItem("left<c>center<r>right"); var_Items->PutCellValueFormat(h,long(0),EXG2ANTTLib::exHTML); spG2antt1->EndUpdate(); |
1822 |
I have a column with Def(exCellSingleLine) property on False, word-wrapping, and I am wondering if possible to update the column's content while user is resizing it
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"MultipleLine"))); var_Column->PutWidth(32); var_Column->PutDef(EXG2ANTTLib::exCellSingleLine,VARIANT_FALSE); var_Column->PutDef(EXG2ANTTLib::exColumnResizeContiguously,VARIANT_TRUE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"SingleLine"))); var_Column1->PutDef(EXG2ANTTLib::exCellSingleLine,VARIANT_FALSE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("This is a bit of long text that should break the line"),long(1),"This is a bit of long text that should break the line"); spG2antt1->EndUpdate(); |
1821 |
Is there an other way to detect if a bar is overlapping any other bar
// BarResizing event - Occurs when a bar is moving or resizing. void OnBarResizingG2antt1(long Item,VARIANT Key) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exVLines); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Etched); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); spG2antt1->PutDefaultItemHeight(22); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Intersect / Count"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"A"); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(521)); var_Column->PutLevelKey(long(1)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L" / With"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"A"); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(520)); var_Column1->PutLevelKey(long(1)); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,148); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutOverlaidType(EXG2ANTTLib::exOverlaidBarsOffset); var_Bar->PutOverlaidGroup(L"TaskB"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(16)); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->Add(L"TaskB"); var_Bar1->PutPattern(EXG2ANTTLib::exPatternBDiagonal); var_Bar1->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("A"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"A","A"); var_Items->AddBar(h,"TaskB",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"B","B"); h = var_Items->AddItem("A"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"A","A"); var_Items->AddBar(h,"TaskB",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"B","B"); h = var_Items->AddItem("A"); var_Items->AddBar(h,"TaskB",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B1","B1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"A","A"); var_Items->AddBar(h,"TaskB",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"B2","B2"); h = var_Items->AddItem("A"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),"B1","B1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"A","A"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,12,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"B2","B2"); spG2antt1->EndUpdate(); |
1820 |
How can I get the absolute position of an item
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",COleDateTime(2017,1,2,0,00,00).operator DATE(),COleDateTime(2017,1,5,0,00,00).operator DATE(),vtMissing,vtMissing); } // MouseMove event - Occurs when the user moves the mouse. void OnMouseMoveG2antt1(short Button,short Shift,long X,long Y) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); OutputDebugStringW( var_Items->GetCellCaption(spG2antt1->GetItemFromPoint(-1,-1,c,hit),"Position") ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2017,1,1,0,00,00).operator DATE()); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); spG2antt1->PutBackColorAlternate(RGB(240,240,240)); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Def")))->PutDisplayFilterButton(VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root"); var_Items->InsertItem(var_Items->InsertItem(h,vtMissing,"Child 1"),vtMissing,"Sub-Child 1"); var_Items->InsertItem(var_Items->InsertItem(h,vtMissing,"Child 2"),vtMissing,"Sub-Child 2"); spG2antt1->PutItems(spG2antt1->GetItems(long(-1)),vtMissing); spG2antt1->PutItems(spG2antt1->GetItems(long(-1)),vtMissing); spG2antt1->PutItems(spG2antt1->GetItems(long(-1)),vtMissing); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column->PutFormatColumn(L"1 apos ``"); var_Column->PutVisible(VARIANT_FALSE); spG2antt1->EndUpdate(); |
1819 |
How do I sort the index column as numeric (Method 2)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellData(Item,long(1),var_Items->GetCellCaption(Item,long(1))); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutColumnAutoResize(VARIANT_TRUE); spG2antt1->PutShowFocusRect(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Next"))); var_Column->PutDef(EXG2ANTTLib::exCellPaddingLeft,long(4)); var_Column->PutDef(EXG2ANTTLib::exHeaderPaddingLeft,long(4)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Index"))); var_Column1->PutAllowSizing(VARIANT_FALSE); var_Column1->PutWidth(48); var_Column1->PutFormatColumn(L"(((0 := (1 index ``)) mod 3) case ( default: ``; 0 : `<r><fgcolor=B0B0B0>`; 1: ``; 2 : `<c><fgcolor=808080>` )) + str(=:0)"); var_Column1->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column1->PutSortType(EXG2ANTTLib::SortUserData); var_Column1->PutPosition(0); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Item 1"); var_Items->AddItem("Item 2"); var_Items->AddItem("Item 3"); var_Items->AddItem("Item 4"); var_Items->AddItem("Item 5"); var_Items->AddItem("Item 6"); var_Items->AddItem("Item 7"); var_Items->AddItem("Item 8"); var_Items->AddItem("Item 9"); var_Items->AddItem("Item 10"); spG2antt1->EndUpdate(); |
1818 |
How do I sort the index column as numeric (Method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Sort Index As String (Default)"))); var_Column->PutFormatColumn(L"1 index ``"); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Sort Index As Numeric"))); var_Column1->PutComputedField(L"%C0"); var_Column1->PutSortType(EXG2ANTTLib::SortNumeric); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); spG2antt1->EndUpdate(); |
1817 |
How can I put icons/images into buttons
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutColumnAutoResize(VARIANT_TRUE); spG2antt1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") + "lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" + "0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" + "NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"C+B"))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(48); var_Column->PutFormatColumn(L"` <img>` + ( 1 + (1 index ``) mod 3 ) + `</img> `"); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutDef(EXG2ANTTLib::exCellHasButton,VARIANT_TRUE); var_Column->PutDef(EXG2ANTTLib::exCellButtonAutoWidth,VARIANT_TRUE); spG2antt1->GetColumns()->Add(L""); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exVLines); spG2antt1->PutDefaultItemHeight(20); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); spG2antt1->EndUpdate(); |
1816 |
Is it possible to have a CheckBox and Button TOGETHER on all cells in a column
// ButtonClick event - Occurs when user clicks on the cell's button. void OnButtonClickG2antt1(long Item,long ColIndex,VARIANT Key) { OutputDebugStringW( L"ButtonClick" ); /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"Key" ); } // CellStateChanged event - Fired after cell's state has been changed. void OnCellStateChangedG2antt1(long Item,long ColIndex) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"CellStateChanged" ); OutputDebugStringW( L"Item" ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutColumnAutoResize(VARIANT_TRUE); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L""))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(32); var_Column->PutFormatColumn(L"1 index ``"); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Def"))); var_Column1->PutAllowSizing(VARIANT_FALSE); var_Column1->PutWidth(48); var_Column1->PutFormatColumn(L"` `"); var_Column1->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column1->PutDef(EXG2ANTTLib::exCellHasButton,VARIANT_TRUE); var_Column1->PutDef(EXG2ANTTLib::exCellButtonAutoWidth,VARIANT_TRUE); spG2antt1->GetColumns()->Add(L""); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); var_Items->AddItem(""); spG2antt1->EndUpdate(); |
1815 |
Does filtering work with umlauts / accents characters
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Names"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutFilterType(EXG2ANTTLib::exPattern); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Mantel"); var_Items->AddItem("Mechanik"); var_Items->AddItem("Motor"); var_Items->AddItem("Murks"); var_Items->AddItem("Märchen"); var_Items->AddItem("Möhren"); var_Items->AddItem("Mühle"); var_Items->AddItem("Sérigraphie"); spG2antt1->GetColumns()->GetItem(long(0))->PutFilter(L"*ä*"); spG2antt1->ApplyFilter(); spG2antt1->EndUpdate(); |
1814 |
How can I temporarily disable resizing the overview part of the control
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); spG2antt1->PutOnResizeControl(EXG2ANTTLib::exDisableOverview); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutOverviewVisible(EXG2ANTTLib::OverviewVisibleEnum(EXG2ANTTLib::exOverviewSplitter | EXG2ANTTLib::exOverviewShowDateTimeScale | EXG2ANTTLib::exOverviewAllowVerticalScroll | EXG2ANTTLib::exOverviewShowAllVisible)); var_Chart->PutOverviewHeight(32); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Item 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 2"),"Task",COleDateTime(2001,2,2,0,00,00).operator DATE(),COleDateTime(2001,2,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 3"),"Task",COleDateTime(2001,3,2,0,00,00).operator DATE(),COleDateTime(2001,3,11,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1813 |
Is it possible to resize the overview part of the control at runtime
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetVisualAppearance()->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABVADg6AADACAxSDEMQBQKAAzQFAYbhgHCGAAGUYBRgmFgAQhFcZQSBcEgTDaMYzgMBYJhEMQyDSAUIjPEyMg0DjIIwgJIUaw0GSXIRkGQZC") + "hGJooTJQMrTZIEbQxHSkIyRVTmZACS5NRZPYy0FAkQhlFSbJBCOKwVomR5KUxTVg1DJwahLCKULLhGI7KgObIRSJOcZ1XAdCQ0cB0XpAC6LaqSA4nSjKcqwJKEZRJIyj" + "JwgSrrWhePoJYBVAAQPQdDYaCivK5uWK6PqKUIlZBQGQVNS1MRrLSEcwgPKgAyzDadZzfQAWTZFTQjN61RgtXR6eyoAJ0aziFDVFo0WRlEwacorGhcbgPPrCRrxGBVNw" + "gGOJo4kIeASB0Zw/iGDoym6dobh2XpiDWJo5HMd56h6dxjlICIEhQDQmDOIZUmQZZlAADpYHIEQ3nUGgNhCEIhAkawamAAAYEWRAGB2bA2EqYg2AyA4glgPgSgQYRIEI" + "FoEmEeBWBiBphFAAgPDwDgDEycQ4A0Q5IwkDwjgyWA8k4SIsmUNoPEOFJbD0DhjHINA3E8Q4eDiDojhiYJmg+Ixokic4LmKQxiCkNk2CCX4DmGaA0nAN4NBiDJSDwTgT" + "Eycg4E0WIYlcPJiiiMJZhCTYpgCcw5g2OYOGWGQmCkEJkheYopGoVw1GSGQuA2ExIlOQJcDOZJzEDSJNBiAgiU4Q5GCeChNHkHJygsaBzGaCYimiCY0mMNZoCMWhUDUJ" + "5pkYTIDk6YxwkwO5NlMOoch6JQJm4U4JCIMxWFSKbCBoKIgmJDAuDgKhohKIoTk0GhaHOJgNiMKJuDaaYzHCTYnAyaZmjSKIiDiCghjEYg6AaR4yk0OpOiFSQLAKNgjG" + "cQ40lkMhOmqZo7DKTpzG6Pw3CmYx2HiNAsCqBh8h6Z5bh6T4oC0G4Im+OAtlMNpTjUTYDCKVo2C3QBLi6a5bH6YY4EyehzAGO4wEwDoejwK5rnK95vDgPJsDWTBjjSWA" + "xnEK5aleNhriuawKi8Lp7H8HpHHGXBskyQpxguXwNgMTpDFiRZDnEExfBSPRvHuXwYkycYslae5NjMQwrDGNZxFyHINDsDRTBMKZKnKLIwm2S4xF0Jw8lKTIcm9eA0hy" + "QwuksM5jiyVQwnQDQIlaVo0EyLwQlGcRNCME5EjKfYXGSWEhDMQ5QnOahHG6KwoFOCoFiOaBNlcdIjiQag7HOL0dwuxKC1aeNQI4BQihNDoEwXowxmh8CIL8Yg8ROBfA" + "SMcaIOR6CHBkMgLgrwUjLHkHMG4NQaBzE4MQaIyw5gxEsH0Dw9FBBNA6PUDoLwpjTHqF0N4WQShSHgGwcY2RkhdFCL8bYdwOivDqNse4fRnh5G+PYEgaR1B0E4B4D4ix" + "xB4G8E8SI5R8D+DeJUc4eRPB/EaJ8DwpwojDHUPofwtxYjtH2F4d4sx3j7E+AcXo8B9geFCNYOIHhfg/GmPQPoXw3jZHuPoX4hxuj1H8J8T43RPhDEgM8eo/B/iQGuPw" + "fxEh1guAIAwQAgCAg"); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutOverviewVisible(EXG2ANTTLib::OverviewVisibleEnum(EXG2ANTTLib::exOverviewSplitter | EXG2ANTTLib::exOverviewShowDateTimeScale | EXG2ANTTLib::exOverviewAllowVerticalScroll | EXG2ANTTLib::exOverviewShowAllVisible)); var_Chart->PutOverviewHeight(32); var_Chart->PutOverviewSelBackColor(0x1000000); var_Chart->PutOverviewBackColor(RGB(250,250,250)); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Item 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 2"),"Task",COleDateTime(2001,2,2,0,00,00).operator DATE(),COleDateTime(2001,2,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 3"),"Task",COleDateTime(2001,3,2,0,00,00).operator DATE(),COleDateTime(2001,3,11,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1812 |
You've provided examples of how to create bars for each record of a MS Access table, however I would like to create a database connected Gantt that has multiple bars per item/resource. Could you please advise
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),"0",vtMissing); var_Items->DefineSummaryBars(Item,"0",-3,"0"); var_Items->AddBar(Item,"SummaryB",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),"1",vtMissing); var_Items->DefineSummaryBars(Item,"1",-3,"1"); var_Items->PutItemBackColor(Item,RGB(240,240,240)); spG2antt1->GetChart()->PutItemBackColor(Item,RGB(240,240,240)); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),var_Items->GetItemBar(Item,"",EXG2ANTTLib::exBarsCount),vtMissing); var_Items->AddBar(Item,"TaskB",var_Items->GetCellValue(Item,long(3)),var_Items->GetCellValue(Item,long(4)),var_Items->GetItemBar(Item,"",EXG2ANTTLib::exBarsCount),vtMissing); } // MouseDown event - Occurs when the user presses a mouse button. void OnMouseDownG2antt1(short Button,short Shift,long X,long Y) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); long i = spG2antt1->GetItemFromPoint(-1,-1,c,hit); spG2antt1->PutFullRowSelect(spG2antt1->GetColumns()->GetItem(c)->GetData()); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->PutHeaderHeight(22); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Flat); spG2antt1->PutBackColorLock(RGB(240,240,240)); spG2antt1->PutBackColorHeader(spG2antt1->GetBackColorLock()); spG2antt1->PutHasLines(EXG2ANTTLib::exNoLine); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutSortBarVisible(VARIANT_FALSE); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->PutReadOnly(EXG2ANTTLib::exReadOnly); spG2antt1->PutShowFocusRect(VARIANT_FALSE); spG2antt1->PutCountLockedColumns(1); spG2antt1->PutAutoDrag(EXG2ANTTLib::exAutoDragScroll); spG2antt1->PutSingleSort(VARIANT_FALSE); spG2antt1->PutColumnsAllowSizing(VARIANT_TRUE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutGridLineStyle(EXG2ANTTLib::exGridLinesSolid); spG2antt1->PutGridLineColor(RGB(220,220,220)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,256); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHeight(15); var_Bar->PutColor(RGB(128,128,128)); var_Bar->PutStartColor(RGB(204,204,0)); var_Bar->PutEndColor(var_Bar->GetStartColor()); var_Bar->PutOverlaidType(EXG2ANTTLib::exOverlaidBarsStack); var_Bar->PutOverlaidGroup(L"Task,TaskB"); var_Bar->PutPattern(EXG2ANTTLib::PatternEnum(EXG2ANTTLib::exPatternGradientVBox | EXG2ANTTLib::exPatternBox)); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->Copy(L"Task",L"TaskB"); var_Bar1->PutColor(RGB(128,128,128)); var_Bar1->PutStartColor(RGB(153,153,0)); var_Bar1->PutEndColor(var_Bar1->GetStartColor()); EXG2ANTTLib::IBarPtr var_Bar2 = var_Chart->GetBars()->GetItem("Summary"); var_Bar2->PutOverlaidType(EXG2ANTTLib::exOverlaidBarsStack); var_Bar2->PutOverlaidGroup(L"Summary,SummaryB"); var_Bar2->PutColor(RGB(204,204,0)); var_Bar2->PutStartColor(var_Bar2->GetColor()); var_Bar2->PutEndColor(var_Bar2->GetColor()); EXG2ANTTLib::IBarPtr var_Bar3 = var_Chart->GetBars()->Copy(L"Summary",L"SummaryB"); var_Bar3->PutColor(RGB(153,153,0)); var_Bar3->PutStartColor(var_Bar3->GetColor()); var_Bar3->PutEndColor(var_Bar3->GetColor()); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(0))->PutData(long(-1)); spG2antt1->PutLayout(L"singlesort=\"C5:1\";multiplesort=\" C1:2\""); spG2antt1->EndUpdate(); |
1811 |
How can I filter for multiple captions on a single column, using OR clause
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutColumnAutoResize(VARIANT_TRUE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); spG2antt1->PutMarkSearchColumn(VARIANT_TRUE); spG2antt1->PutSearchColumnIndex(1); spG2antt1->PutFilterBarPromptVisible(VARIANT_TRUE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Name")))->PutWidth(96); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Title"))); var_Column->PutWidth(96); var_Columns->Add(L"City"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h0 = var_Items->AddItem("Nancy Davolio"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Seattle"); h0 = var_Items->AddItem("Andrew Fuller"); var_Items->PutCellValue(h0,long(1),"Vice President, Sales"); var_Items->PutCellValue(h0,long(2),"Tacoma"); var_Items->PutSelectItem(h0,VARIANT_TRUE); h0 = var_Items->AddItem("Janet Leverling"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Kirkland"); h0 = var_Items->AddItem("Margaret Peacock"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Redmond"); h0 = var_Items->AddItem("Steven Buchanan"); var_Items->PutCellValue(h0,long(1),"Sales Manager"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Michael Suyama"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Robert King"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Laura Callahan"); var_Items->PutCellValue(h0,long(1),"Inside Sales Coordinator"); var_Items->PutCellValue(h0,long(2),"Seattle"); h0 = var_Items->AddItem("Anne Dodsworth"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); spG2antt1->PutFilterBarPromptColumns("1"); spG2antt1->PutFilterBarPromptPattern(L"Vice Inside"); spG2antt1->PutFilterBarPromptType(EXG2ANTTLib::exFilterPromptContainsAny); spG2antt1->EndUpdate(); |
1810 |
How can I filter for multiple captions on a single column, using AND clause
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutColumnAutoResize(VARIANT_TRUE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); spG2antt1->PutMarkSearchColumn(VARIANT_TRUE); spG2antt1->PutSearchColumnIndex(1); spG2antt1->PutFilterBarPromptVisible(VARIANT_TRUE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Name")))->PutWidth(96); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Title"))); var_Column->PutWidth(96); var_Columns->Add(L"City"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h0 = var_Items->AddItem("Nancy Davolio"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Seattle"); h0 = var_Items->AddItem("Andrew Fuller"); var_Items->PutCellValue(h0,long(1),"Vice President, Sales"); var_Items->PutCellValue(h0,long(2),"Tacoma"); var_Items->PutSelectItem(h0,VARIANT_TRUE); h0 = var_Items->AddItem("Janet Leverling"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Kirkland"); h0 = var_Items->AddItem("Margaret Peacock"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Redmond"); h0 = var_Items->AddItem("Steven Buchanan"); var_Items->PutCellValue(h0,long(1),"Sales Manager"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Michael Suyama"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Robert King"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Laura Callahan"); var_Items->PutCellValue(h0,long(1),"Inside Sales Coordinator"); var_Items->PutCellValue(h0,long(2),"Seattle"); h0 = var_Items->AddItem("Anne Dodsworth"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); spG2antt1->PutFilterBarPromptColumns("1"); spG2antt1->PutFilterBarPromptPattern(L"Vice Sales"); spG2antt1->PutFilterBarPromptType(EXG2ANTTLib::exFilterPromptContainsAll); spG2antt1->EndUpdate(); |
1809 |
How can I display the limits/margins of the project, in the overview part of the control
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetVisualAppearance()->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABVADg6AADACAxSDEMQBQKAAzQFAYbhgHCGAAGUYBRgmFgAQhFcZQSBcEgTDaMYzgMBYJhEMQyDSAUIjPEyMg0DjIIwgJIUaw0GSXIRkGQZC") + "hGJooTJQMrTZIEbQxHSkIyRVTmZACS5NRZPYy0FAkQhlFSbJBCOKwVomR5KUxTVg1DJwahLCKULLhGI7KgObIRSJOcZ1XAdCQ0cB0XpAC6LaqSA4nSjKcqwJKEZRJIyj" + "JwgSrrWhePoJYBVAAQPQdDYaCivK5uWK6PqKUIlZBQGQVNS1MRrLSEcwgPKgAyzDadZzfQAWTZFTQjN61RgtXR6eyoAJ0aziFDVFo0WRlEwacorGhcbgPPrCRrxGBVNw" + "gGOJo4kIeASB0Zw/iGDoym6dobh2XpiDWJo5HMd56h6dxjlICIEhQDQmDOIZUmQZZlAADpYHIEQ3nUGgNhCEIhAkawamAAAYEWRAGB2bA2EqYg2AyA4glgPgSgQYRIEI" + "FoEmEeBWBiBphFAAgPDwDgDEycQ4A0Q5IwkDwjgyWA8k4SIsmUNoPEOFJbD0DhjHINA3E8Q4eDiDojhiYJmg+Ixokic4LmKQxiCkNk2CCX4DmGaA0nAN4NBiDJSDwTgT" + "Eycg4E0WIYlcPJiiiMJZhCTYpgCcw5g2OYOGWGQmCkEJkheYopGoVw1GSGQuA2ExIlOQJcDOZJzEDSJNBiAgiU4Q5GCeChNHkHJygsaBzGaCYimiCY0mMNZoCMWhUDUJ" + "5pkYTIDk6YxwkwO5NlMOoch6JQJm4U4JCIMxWFSKbCBoKIgmJDAuDgKhohKIoTk0GhaHOJgNiMKJuDaaYzHCTYnAyaZmjSKIiDiCghjEYg6AaR4yk0OpOiFSQLAKNgjG" + "cQ40lkMhOmqZo7DKTpzG6Pw3CmYx2HiNAsCqBh8h6Z5bh6T4oC0G4Im+OAtlMNpTjUTYDCKVo2C3QBLi6a5bH6YY4EyehzAGO4wEwDoejwK5rnK95vDgPJsDWTBjjSWA" + "xnEK5aleNhriuawKi8Lp7H8HpHHGXBskyQpxguXwNgMTpDFiRZDnEExfBSPRvHuXwYkycYslae5NjMQwrDGNZxFyHINDsDRTBMKZKnKLIwm2S4xF0Jw8lKTIcm9eA0hy" + "QwuksM5jiyVQwnQDQIlaVo0EyLwQlGcRNCME5EjKfYXGSWEhDMQ5QnOahHG6KwoFOCoFiOaBNlcdIjiQag7HOL0dwuxKC1aeNQI4BQihNDoEwXowxmh8CIL8Yg8ROBfA" + "SMcaIOR6CHBkMgLgrwUjLHkHMG4NQaBzE4MQaIyw5gxEsH0Dw9FBBNA6PUDoLwpjTHqF0N4WQShSHgGwcY2RkhdFCL8bYdwOivDqNse4fRnh5G+PYEgaR1B0E4B4D4ix" + "xB4G8E8SI5R8D+DeJUc4eRPB/EaJ8DwpwojDHUPofwtxYjtH2F4d4sx3j7E+AcXo8B9geFCNYOIHhfg/GmPQPoXw3jZHuPoX4hxuj1H8J8T43RPhDEgM8eo/B/iQGuPw" + "fxEh1guAIAwQAgCAg"); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutOverviewVisible(EXG2ANTTLib::OverviewVisibleEnum(0x400 | EXG2ANTTLib::exOverviewShowSelMargins | EXG2ANTTLib::exOverviewShowMargins | EXG2ANTTLib::exOverviewShowDateTimeScaleBottom | EXG2ANTTLib::exOverviewShowAllVisible)); var_Chart->PutOverviewHeight(64); var_Chart->PutOverviewSelBackColor(0x1000000); var_Chart->PutOverviewBackColor(RGB(250,250,250)); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Item 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 2"),"Task",COleDateTime(2001,2,2,0,00,00).operator DATE(),COleDateTime(2001,2,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 3"),"Task",COleDateTime(2001,3,2,0,00,00).operator DATE(),COleDateTime(2001,3,11,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1808 |
Is it possible to display a time-scale for the overview part of the control (separated)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutOverviewVisible(EXG2ANTTLib::OverviewVisibleEnum(EXG2ANTTLib::exOverviewShowDateTimeScaleSplit | EXG2ANTTLib::exOverviewShowAllVisible)); var_Chart->PutOverviewHeight(48); var_Chart->PutLevelCount(2); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Item 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 2"),"Task",COleDateTime(2001,2,2,0,00,00).operator DATE(),COleDateTime(2001,2,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 3"),"Task",COleDateTime(2001,3,2,0,00,00).operator DATE(),COleDateTime(2001,3,11,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1807 |
Is it possible to display a time-scale for the overview part of the control
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutOverviewVisible(EXG2ANTTLib::OverviewVisibleEnum(EXG2ANTTLib::exOverviewShowDateTimeScale | EXG2ANTTLib::exOverviewShowAllVisible)); var_Chart->PutLevelCount(2); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Item 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 2"),"Task",COleDateTime(2001,2,2,0,00,00).operator DATE(),COleDateTime(2001,2,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 3"),"Task",COleDateTime(2001,3,2,0,00,00).operator DATE(),COleDateTime(2001,3,11,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1806 |
How can I display the time-scale only, in the overview part of the control
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutOverviewVisible(EXG2ANTTLib::OverviewVisibleEnum(EXG2ANTTLib::exOverviewShowDateTimeScale | EXG2ANTTLib::exOverviewHideBars | EXG2ANTTLib::exOverviewShowAllVisible)); var_Chart->PutLevelCount(2); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Item 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 2"),"Task",COleDateTime(2001,2,2,0,00,00).operator DATE(),COleDateTime(2001,2,11,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 3"),"Task",COleDateTime(2001,3,2,0,00,00).operator DATE(),COleDateTime(2001,3,11,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1805 |
How can I detect that the mouse pointer is within an InsideZoom object
|
1804 |
Is it possible to word-wrap text/caption on the bar, so it gets displayed on multiple lines
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->PutItemsAllowSizing(EXG2ANTTLib::exResizeItem); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exHLines); spG2antt1->PutHeaderHeight(28); spG2antt1->PutDefaultItemHeight(24); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Bump); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutDrawGridLines(EXG2ANTTLib::exHLines); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->Copy(L"Task",L"TaskB"); var_Bar->PutHeight(15); var_Bar->PutPattern(EXG2ANTTLib::exPatternBox); var_Bar->PutStartColor(RGB(204,232,255)); var_Bar->PutEndColor(var_Bar->GetStartColor()); var_Bar->PutColor(RGB(0,0,255)); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->GetItem("Task"); var_Bar1->PutHeight(-1); var_Bar1->PutPattern(EXG2ANTTLib::exPatternBox); var_Bar1->PutStartColor(RGB(204,232,255)); var_Bar1->PutEndColor(var_Bar1->GetStartColor()); var_Bar1->PutColor(RGB(0,0,255)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Word-Wrap Inside"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"A1",vtMissing); var_Items->PutItemBar(h,"A1",EXG2ANTTLib::exBarBackgroundExt,"none[(2,2,100%-4,100%-4),text=`This is a bit of text that should break the line`,wordwrap]"); h = var_Items->AddItem("Word-Wrap Inside"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,19,0,00,00).operator DATE(),"A2",vtMissing); var_Items->PutItemBar(h,"A2",EXG2ANTTLib::exBarBackgroundExt,"none[(2,2,100%-4,100%-4),align=0x11,text=`This is a bit of text that should break the line`,wordwrap]"); h = var_Items->AddItem("Word-Wrap Back"); var_Items->AddBar(h,"TaskB",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"A3",vtMissing); var_Items->PutItemBar(h,"A3",EXG2ANTTLib::exBarBackgroundExt,"client[align=0x11,text=`This is a bit of text that should break the line`,wordwrap]"); var_Items->PutItemBar(h,"A3",EXG2ANTTLib::exBarBackgroundExtFlags,long(2)); spG2antt1->EndUpdate(); |
1803 |
Can I set the search box / filterbarprompt to invisible, so I can use my own input and *string* via VBA
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutColumnAutoResize(VARIANT_TRUE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutSearchColumnIndex(1); spG2antt1->PutFilterBarHeight(0); spG2antt1->PutFilterBarPromptVisible(VARIANT_TRUE); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Name")))->PutWidth(96); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Title")))->PutWidth(96); var_Columns->Add(L"City"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h0 = var_Items->AddItem("Nancy Davolio"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Seattle"); h0 = var_Items->AddItem("Andrew Fuller"); var_Items->PutCellValue(h0,long(1),"Vice President, Sales"); var_Items->PutCellValue(h0,long(2),"Tacoma"); var_Items->PutSelectItem(h0,VARIANT_TRUE); h0 = var_Items->AddItem("Janet Leverling"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Kirkland"); h0 = var_Items->AddItem("Margaret Peacock"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"Redmond"); h0 = var_Items->AddItem("Steven Buchanan"); var_Items->PutCellValue(h0,long(1),"Sales Manager"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Michael Suyama"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Robert King"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); h0 = var_Items->AddItem("Laura Callahan"); var_Items->PutCellValue(h0,long(1),"Inside Sales Coordinator"); var_Items->PutCellValue(h0,long(2),"Seattle"); h0 = var_Items->AddItem("Anne Dodsworth"); var_Items->PutCellValue(h0,long(1),"Sales Representative"); var_Items->PutCellValue(h0,long(2),"London"); spG2antt1->PutFilterBarPromptPattern(L"London"); spG2antt1->EndUpdate(); |
1802 |
How to load a hierarchy using the control's DataSource property (Parent-ID-Relation)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->SetParent(Item,var_Items->GetFindItem(var_Items->GetCellValue(Item,"ReportsTo"),"EmployeeID",vtMissing)); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("SELECT * FROM Employees ORDER BY ReportsTo","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutExpandItem(0,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1801 |
How can I highlight the limits/margins of a summary bar, according with the child bars
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABRkIQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjhwkAIIQK/cZRPC0Ow8GSEZAgOKIch6FgCQjEIxDKIsVRZEiDYRmGLpIiOJoWSQBUIyJKoA") + "Q0f6fIziaTpNiGL4yTBPMzyJRcEx1GyBZ5negaAo2AwIQiUBomGahajkMqZQAJaCSCI2Y4eDZCIoTXR1WAxDq3ZruKpLUpOc4DOrEMIwCEBA="); var_Appearance->Add(2,"CP:1 -4 0 5 0"); var_Appearance->Add(3,_bstr_t("gBFLBCJwBAEHhEJAAEhABOMGACAADACAxSDEMQBQKAAzQFAYbhgHCGAAGUYBRgmFgAQhFcZQSKUOQTDKMIziYBYJhEMQyDAAUIjOKsIhkGYcZAGQBJCjWGodQRHc5TN") + "CMTRRECDY4kAYpAiKRYbSpAcyQHQ8bQtHwYKAoOg6JjWIAHRqCMI0XINHQ3FwaRJsCwoJhOZIDWZENDQTSsLSxJSkIRfe4wArNf4XVBVMqSdKEZRJLybJwADApAo2eIl" + "QjJdQ4TSdBSdQwDLYhECpbwCT6JT7jGLQJZsNyvBLIYDrKA8UozFqHQRYNhxDZNShhM6rMigPQQAq8AKlRbVNzXLamLwHRS9BpoORhUjHD4bVxVOyaPpAAaBFbhI44QZ" + "OHYNYfjgaI0BySp8HMVZdlgaxtBqexWkqOw1lGbZzlwfQ0AwYR/gka5FiMGpgkQYYviGV4kBUWpmlsaYGHMEgACECQUAaEYMHQHRHCGFRBECRJkGQQgTGCVBoDYQhCgQ" + "JZoG4EIAGEFwGB+dwxHaB5iAabReggYhGnUToJGIRgCCiCBdjiNguGmYo4gIKoMGIKIeDSCYTGiXg4EITo3hAiJAICA=="); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->GetBars()->GetItem("Summary")->PutColor(0x3000000); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Summary"); var_Items->AddBar(hSummary,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"",vtMissing); long hTask = var_Items->InsertItem(hSummary,vtMissing,"Task A"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task B"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task C"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); var_Items->DefineSummaryBars(hSummary,"",-1,"<*>"); var_Items->PutItemBar(hSummary,"",EXG2ANTTLib::exSummaryBarBackColor,long(33554432)); spG2antt1->EndUpdate(); |